From: William A. Rowe Jr Date: Sat, 18 May 2002 21:43:24 +0000 (+0000) Subject: As the prior commit message indicated, pass the accept thread a listen X-Git-Tag: 2.0.37~337 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e76315c39783659720029dfcbde30bdd58f6dd58;p=apache As the prior commit message indicated, pass the accept thread a listen rec as opposed to simply the listen socket. However, the prior commit (which I crossed up with this patch) really closed a segfault where we attempted to log messages to ap_server_conf, after the server conf was destroyed, and prior to setting the new value in the next go-around of post_config. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95173 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/mpm/winnt/mpm_winnt.c b/server/mpm/winnt/mpm_winnt.c index 0f41188e66..f9c7614cef 100644 --- a/server/mpm/winnt/mpm_winnt.c +++ b/server/mpm/winnt/mpm_winnt.c @@ -924,15 +924,16 @@ static PCOMP_CONTEXT win9x_get_connection(PCOMP_CONTEXT context) * Worker threads block on the ThreadDispatch IOCompletionPort awaiting * connections to service. */ -static void winnt_accept(void *listen_socket) +static void winnt_accept(void *lr_) { + ap_listen_rec *lr = (ap_listen_rec *)lr_; apr_os_sock_info_t sockinfo; PCOMP_CONTEXT context = NULL; DWORD BytesRead; SOCKET nlsd; int rv; - nlsd = (SOCKET) listen_socket; + apr_os_sock_get(&nlsd, lr->sd); while (!shutdown_in_progress) { if (!context) { @@ -1190,14 +1191,14 @@ static void create_listener_thread() _beginthreadex(NULL, 0, (LPTHREAD_START_ROUTINE) win9x_accept, NULL, 0, &tid); } else { - /* Start an accept thread per listener */ - SOCKET nlsd; /* native listening sock descriptor */ + /* Start an accept thread per listener + * XXX: Why would we have a NULL sd in our listeners? + */ ap_listen_rec *lr; for (lr = ap_listeners; lr; lr = lr->next) { if (lr->sd != NULL) { - apr_os_sock_get(&nlsd, lr->sd); _beginthreadex(NULL, 1000, (LPTHREAD_START_ROUTINE) winnt_accept, - (void *) nlsd, 0, &tid); + (void *) lr, 0, &tid); } } }