Commit 77133b88 authored by William A. Rowe Jr's avatar William A. Rowe Jr
Browse files

  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
parent 444c0fa0
Loading
Loading
Loading
Loading
+7 −6
Changes for server/mpm/winnt/mpm_winnt.c: 7 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -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);
            }
        }
    }