https://bz.apache.org/bugzilla/show_bug.cgi?id=65627

--- Comment #3 from Yann Ylavic <ylavic....@gmail.com> ---
Does this always imply mpm_itk?

I see that mpm_itk does this:

    ap_hook_process_connection(itk_fork_process, NULL, NULL,
                               APR_HOOK_REALLY_FIRST);

then:

int itk_fork_process(conn_rec *c)
{
    if (have_forked) {
         return DECLINED;
    }

    pid_t pid = fork(), child_pid;
    int status;
    switch (pid) {
    case -1:
        [...]
        return HTTP_INTERNAL_SERVER_ERROR;
    case 0:
        /* Child; runs processing as usual, then dies.
         * This is a bit tricky in that we need to run
ap_run_process_connection()
         * even though we are a process_connection hook ourselves!
         * That is the only way we can exit cleanly after the hook
         * is done. Thus, we set have_forked to signal that we don't
         * want to end up in infinite recursion.
         */
        have_forked = 1;
        ap_close_listeners();
        ap_run_process_connection(c);
        ap_lingering_close(c);
        exit(0);
    default: /* parent; just wait for child to be done */
        do {
            child_pid = waitpid(pid, &status, 0);
        } while (child_pid == -1 && errno == EINTR);
        [...]
        /*
         * It is important that ap_lingering_close() is called in the child
         * and not here, ...
         * However, we close the socket itself here so that we don't keep a
         * reference to it around, and then set the socket pointer to NULL so
         * that when prefork tries to close it, it goes into early exit.
         */
        apr_socket_close(ap_get_conn_socket(c));
        ap_set_core_module_config(c->conn_config, NULL);

        /* make sure the MPM does not process this connection */
        return OK;
    }
}

So:
    ap_set_core_module_config(c->conn_config, NULL);
is what sets csd to NULL in ap_lingering_close.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscr...@httpd.apache.org
For additional commands, e-mail: bugs-h...@httpd.apache.org

Reply via email to