From: Jeff Trawick Date: Mon, 16 May 2011 02:19:42 +0000 (+0000) Subject: fill in conn_rec::current_thread for WinNT, NetWare, and OS/2 MPMs X-Git-Tag: 2.3.13~126 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f60e484691a2e21d48dd20ff7d8447e496ed1903;p=apache fill in conn_rec::current_thread for WinNT, NetWare, and OS/2 MPMs git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1103595 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/STATUS b/STATUS index 0aa53f2e29..4d31399008 100644 --- 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. diff --git a/server/mpm/mpmt_os2/mpmt_os2_child.c b/server/mpm/mpmt_os2/mpmt_os2_child.c index d19aaada0e..fd5afba8bf 100644 --- a/server/mpm/mpmt_os2/mpmt_os2_child.c +++ b/server/mpm/mpmt_os2/mpmt_os2_child.c @@ -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( ®_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); } diff --git a/server/mpm/netware/mpm_netware.c b/server/mpm/netware/mpm_netware.c index f30fcbf354..183d5555c5 100644 --- a/server/mpm/netware/mpm_netware.c +++ b/server/mpm/netware/mpm_netware.c @@ -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); } diff --git a/server/mpm/winnt/child.c b/server/mpm/winnt/child.c index db00d7a7db..70841371c7 100644 --- a/server/mpm/winnt/child.c +++ b/server/mpm/winnt/child.c @@ -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. */