]> granicus.if.org Git - apache/commitdiff
fill in conn_rec::current_thread for WinNT, NetWare, and OS/2 MPMs
authorJeff Trawick <trawick@apache.org>
Mon, 16 May 2011 02:19:42 +0000 (02:19 +0000)
committerJeff Trawick <trawick@apache.org>
Mon, 16 May 2011 02:19:42 +0000 (02:19 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1103595 13f79535-47bb-0310-9956-ffa450edef68

STATUS
server/mpm/mpmt_os2/mpmt_os2_child.c
server/mpm/netware/mpm_netware.c
server/mpm/winnt/child.c

diff --git a/STATUS b/STATUS
index 0aa53f2e29f584b17f52e7e9f9e988509cc313b1..4d313990081e33206f1c882fcce1cd014b624ac3 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -81,13 +81,6 @@ RELEASE SHOWSTOPPERS:
     practices and not use deprecated features.
       wrowe sez: be specific or this isn't a SHOWSTOPPER
 
-  * Not all MPMs are updated to set conn_rec::current_thread correctly.
-      (Prefork, Worker, Event, Simple are updated).
-      jim sez: Then we just ship with those... mark any others as
-                experimental, pgollucci +1 jim
-      wrowe sez: no... Then we just don't ship those (see #1 above)
-                 Is this still an issue, didn't jtrawick fix this?
-
   * The mod_session* modules need to be checked that their hooks respect
     the returning of int (HTTP status codes) and apr_status_t as appropriate,
     and any anomolies fixed.
index d19aaada0ec227a87351172005346aae71afa2d6..fd5afba8bfb843796c1a10009e2d15053687fce0 100644 (file)
@@ -342,6 +342,8 @@ ULONG APIENTRY thread_exception_handler(EXCEPTIONREPORTRECORD *pReportRec,
 
 static void worker_main(void *vpArg)
 {
+    apr_thread_t *thd = NULL;
+    apr_os_thread_t osthd;
     long conn_id;
     conn_rec *current_conn;
     apr_pool_t *pconn;
@@ -361,6 +363,9 @@ static void worker_main(void *vpArg)
     /* Trap exceptions in this thread so we don't take down the whole process */
     DosSetExceptionHandler( &reg_rec );
 
+    osthd = apr_os_thread_current();
+    apr_os_thread_put(&thd, &osthd, pchild);
+
     rc = DosOpenQueue(&owner, &workq,
                       apr_psprintf(pchild, "/queues/httpd/work.%d", getpid()));
 
@@ -387,6 +392,7 @@ static void worker_main(void *vpArg)
                                                 sbh, bucket_alloc);
 
         if (current_conn) {
+            current_conn->current_thread = thd;
             ap_process_connection(current_conn, worker_args->conn_sd);
             ap_lingering_close(current_conn);
         }
index f30fcbf354d2cd7cb81535f868ead323685275bf..183d5555c5314f4e4322443314e18849cc7820cd 100644 (file)
@@ -342,6 +342,8 @@ void worker_main(void *arg)
     conn_rec *current_conn;
     apr_status_t stat = APR_EINIT;
     ap_sb_handle_t *sbh;
+    apr_thread_t *thd = NULL;
+    apr_os_thread_t osthd;
 
     int my_worker_num = (int)arg;
     apr_socket_t *csd = NULL;
@@ -354,6 +356,9 @@ void worker_main(void *arg)
     struct timeval tv;
     int wouldblock_retry;
 
+    osthd = apr_os_thread_current();
+    apr_os_thread_put(&thd, &osthd, pmain);
+
     tv.tv_sec = 1;
     tv.tv_usec = 0;
 
@@ -522,6 +527,7 @@ void worker_main(void *arg)
                                                 my_worker_num, sbh,
                                                 bucket_alloc);
         if (current_conn) {
+            current_conn->current_thread = thd;
             ap_process_connection(current_conn, csd);
             ap_lingering_close(current_conn);
         }
index db00d7a7db8e8e6403c0b09ac86e1e2ac51a8b96..70841371c779b189c368fea72ca4cc45ddbf0eac 100644 (file)
@@ -729,6 +729,8 @@ static winnt_conn_ctx_t *winnt_get_connection(winnt_conn_ctx_t *context)
  */
 static DWORD __stdcall worker_main(void *thread_num_val)
 {
+    apr_thread_t *thd;
+    apr_os_thread_t osthd;
     static int requests_this_child = 0;
     winnt_conn_ctx_t *context = NULL;
     int thread_num = (int)thread_num_val;
@@ -738,6 +740,9 @@ static DWORD __stdcall worker_main(void *thread_num_val)
     conn_rec *c;
     apr_int32_t disconnected;
 
+    osthd = apr_os_thread_current();
+    apr_os_thread_put(&thd, &osthd, pchild);
+
     while (1) {
 
         ap_update_child_status_from_indexes(0, thread_num, SERVER_READY, NULL);
@@ -774,6 +779,8 @@ static DWORD __stdcall worker_main(void *thread_num_val)
             continue;
         }
 
+        c->current_thread = thd;
+
         /* follow ap_process_connection(c, context->sock) logic
          * as it left us no chance to reinject our first data bucket.
          */