From: Jim Jagielski Date: Thu, 5 Mar 2015 14:54:19 +0000 (+0000) Subject: Merge r1663017 from trunk: X-Git-Tag: 2.4.13~364 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6b71fcb9fa68fa0febab68974426c556eef39b4f;p=apache Merge r1663017 from trunk: mpm_event: follow up to r1538490, r1545736, r1604350, r1639614 and r1642868. Clear and restore sbh in notify_suspend() and notify_resume() respectively. Submitted by: ylavic Reviewed/backported by: jim git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1664365 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 223e36f167..3a0a4b8a60 100644 --- a/CHANGES +++ b/CHANGES @@ -29,6 +29,9 @@ Changes with Apache 2.4.13 PR 57100. [Michael Kaufmann , Yann Ylavic] + *) mpm_event: Avoid access to the scoreboard from the connection while + it is suspended (waiting for events). [Eric Covener, Jeff Trawick] + *) mod_ssl: Fix renegotiation failures redirected to an ErrorDocument. PR 57334. [Yann Ylavic]. diff --git a/STATUS b/STATUS index 94450a7448..f4eb81c917 100644 --- a/STATUS +++ b/STATUS @@ -106,14 +106,6 @@ RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT FROM TRUNK: [ start all new proposals below, under PATCHES PROPOSED. ] - *) mpm_event: Clear and restore sbh in notify_suspend() and notify_resume() - respectively. This merges a missing fix from r1545736 (sbh = NULL before - notify_suspend() for write completion, near line 1068 in 2.4.12) which was - missed between r1541207 and r1642858. - trunk patch: http://svn.apache.org/r1663017 - 2.4.x patch: http://people.apache.org/~ylavic/httpd-2.4.x-mpm_event-notify_suspend_sbh.patch - (trunk works, but the above contains the CHANGES entry, which is 2.4.x only...) - +1 ylavic, covener, jim PATCHES PROPOSED TO BACKPORT FROM TRUNK: diff --git a/server/mpm/event/event.c b/server/mpm/event/event.c index 7d2a31c31a..4a33fa081a 100644 --- a/server/mpm/event/event.c +++ b/server/mpm/event/event.c @@ -771,10 +771,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); } @@ -810,10 +812,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 = ( @@ -846,7 +850,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; @@ -910,7 +913,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; } @@ -1009,8 +1012,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; @@ -1103,7 +1105,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); @@ -1121,7 +1122,6 @@ read_request: } else if (cs->pub.state == CONN_STATE_SUSPENDED) { apr_atomic_inc32(&suspended_count); - c->sbh = NULL; notify_suspend(cs); } }