From: Yann Ylavic Date: Sun, 1 Mar 2015 00:44:49 +0000 (+0000) Subject: mpm_event: follow up to r1538490, r1545736, r1604350, r1639614 and r1642868. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d0811c3272fbecd27d78707988d0d531a54f1cb5;p=thirdparty%2Fapache%2Fhttpd.git mpm_event: follow up to r1538490, r1545736, r1604350, r1639614 and r1642868. Clear and restore sbh in notify_suspend() and notify_resume() respectively. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1663017 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/mpm/event/event.c b/server/mpm/event/event.c index 42c8f862a3b..6c50bbd7ef7 100644 --- a/server/mpm/event/event.c +++ b/server/mpm/event/event.c @@ -820,10 +820,12 @@ static void notify_suspend(event_conn_state_t *cs) { ap_run_suspend_connection(cs->c, cs->r); cs->suspended = 1; + cs->c->sbh = NULL; } -static void notify_resume(event_conn_state_t *cs) +static void notify_resume(event_conn_state_t *cs, ap_sb_handle_t *sbh) { + cs->c->sbh = sbh; cs->suspended = 0; ap_run_resume_connection(cs->c, cs->r); } @@ -859,10 +861,12 @@ static int start_lingering_close_common(event_conn_state_t *cs, int in_worker) cs->pub.state = CONN_STATE_LINGER_NORMAL; } apr_atomic_inc32(&lingering_count); - cs->c->sbh = NULL; if (in_worker) { notify_suspend(cs); } + else { + cs->c->sbh = NULL; + } apr_thread_mutex_lock(timeout_mutex); TO_QUEUE_APPEND(*q, cs); cs->pfd.reqevents = ( @@ -895,7 +899,6 @@ static int start_lingering_close_common(event_conn_state_t *cs, int in_worker) static int start_lingering_close_blocking(event_conn_state_t *cs) { if (ap_start_lingering_close(cs->c)) { - cs->c->sbh = NULL; notify_suspend(cs); ap_push_pool(worker_queue_info, cs->p); return 0; @@ -959,7 +962,7 @@ static apr_status_t ptrans_pre_cleanup(void *dummy) event_conn_state_t *cs = dummy; if (cs->suspended) { - notify_resume(cs); + notify_resume(cs, NULL); } return APR_SUCCESS; } @@ -1058,8 +1061,7 @@ static void process_socket(apr_thread_t *thd, apr_pool_t * p, apr_socket_t * soc } else { c = cs->c; - c->sbh = sbh; - notify_resume(cs); + notify_resume(cs, sbh); c->current_thread = thd; /* Subsequent request on a conn, and thread number is part of ID */ c->id = conn_id; @@ -1114,7 +1116,6 @@ read_request: * event thread poll for writeability. */ cs->expiration_time = ap_server_conf->timeout + apr_time_now(); - c->sbh = NULL; notify_suspend(cs); apr_thread_mutex_lock(timeout_mutex); TO_QUEUE_APPEND(write_completion_q, cs); @@ -1153,7 +1154,6 @@ read_request: */ cs->expiration_time = ap_server_conf->keep_alive_timeout + apr_time_now(); - c->sbh = NULL; notify_suspend(cs); apr_thread_mutex_lock(timeout_mutex); TO_QUEUE_APPEND(keepalive_q, cs); @@ -1172,7 +1172,6 @@ read_request: else if (cs->pub.state == CONN_STATE_SUSPENDED) { cs->c->suspended_baton = cs; apr_atomic_inc32(&suspended_count); - c->sbh = NULL; notify_suspend(cs); } }