You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@apache.org on 2011/05/16 04:19:43 UTC

svn commit: r1103595 - in /httpd/httpd/trunk: STATUS server/mpm/mpmt_os2/mpmt_os2_child.c server/mpm/netware/mpm_netware.c server/mpm/winnt/child.c

Author: trawick
Date: Mon May 16 02:19:42 2011
New Revision: 1103595

URL: http://svn.apache.org/viewvc?rev=1103595&view=rev
Log:
fill in conn_rec::current_thread for WinNT, NetWare, and OS/2 MPMs

Modified:
    httpd/httpd/trunk/STATUS
    httpd/httpd/trunk/server/mpm/mpmt_os2/mpmt_os2_child.c
    httpd/httpd/trunk/server/mpm/netware/mpm_netware.c
    httpd/httpd/trunk/server/mpm/winnt/child.c

Modified: httpd/httpd/trunk/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/STATUS?rev=1103595&r1=1103594&r2=1103595&view=diff
==============================================================================
--- httpd/httpd/trunk/STATUS (original)
+++ httpd/httpd/trunk/STATUS Mon May 16 02:19:42 2011
@@ -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.

Modified: httpd/httpd/trunk/server/mpm/mpmt_os2/mpmt_os2_child.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/mpmt_os2/mpmt_os2_child.c?rev=1103595&r1=1103594&r2=1103595&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/mpmt_os2/mpmt_os2_child.c (original)
+++ httpd/httpd/trunk/server/mpm/mpmt_os2/mpmt_os2_child.c Mon May 16 02:19:42 2011
@@ -342,6 +342,8 @@ ULONG APIENTRY thread_exception_handler(
 
 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);
         }

Modified: httpd/httpd/trunk/server/mpm/netware/mpm_netware.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/netware/mpm_netware.c?rev=1103595&r1=1103594&r2=1103595&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/netware/mpm_netware.c (original)
+++ httpd/httpd/trunk/server/mpm/netware/mpm_netware.c Mon May 16 02:19:42 2011
@@ -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);
         }

Modified: httpd/httpd/trunk/server/mpm/winnt/child.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/winnt/child.c?rev=1103595&r1=1103594&r2=1103595&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/winnt/child.c (original)
+++ httpd/httpd/trunk/server/mpm/winnt/child.c Mon May 16 02:19:42 2011
@@ -729,6 +729,8 @@ static winnt_conn_ctx_t *winnt_get_conne
  */
 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 
     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 
             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.
          */