From b6e7d2dbf063f6f32b144534cdef1f691a35ce8e Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Mon, 4 Nov 2013 01:37:31 +0000 Subject: [PATCH] c->sbh can be unexpectedly NULL when the thread that pulls the ready keepalive connection out of the queue laps the thread that put it on the queue. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1538490 13f79535-47bb-0310-9956-ffa450edef68 --- server/mpm/event/event.c | 2 ++ server/mpm/eventopt/eventopt.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/server/mpm/event/event.c b/server/mpm/event/event.c index 2dad7feaab..9da5e65022 100644 --- a/server/mpm/event/event.c +++ b/server/mpm/event/event.c @@ -1066,6 +1066,7 @@ read_request: */ cs->expiration_time = ap_server_conf->keep_alive_timeout + apr_time_now(); + c->sbh = NULL; apr_thread_mutex_lock(timeout_mutex); TO_QUEUE_APPEND(keepalive_q, cs); @@ -1079,6 +1080,7 @@ read_request: "process_socket: apr_pollset_add failure"); AP_DEBUG_ASSERT(rc == APR_SUCCESS); } + return; } else if (cs->pub.state == CONN_STATE_SUSPENDED) { apr_atomic_inc32(&suspended_count); diff --git a/server/mpm/eventopt/eventopt.c b/server/mpm/eventopt/eventopt.c index f73c1582f7..9c80e38720 100644 --- a/server/mpm/eventopt/eventopt.c +++ b/server/mpm/eventopt/eventopt.c @@ -1124,7 +1124,7 @@ read_request: */ cs->expiration_time = ap_server_conf->keep_alive_timeout + apr_time_now(); - + c->sbh = NULL; /* Add work to pollset. */ v = ap_equeue_writer_value(eq); v->timeout_type = TIMEOUT_KEEPALIVE; @@ -1133,6 +1133,7 @@ read_request: v->tag = "process_socket(keepalive)"; ap_equeue_writer_onward(eq); apr_pollset_wakeup(event_pollset); + return; } else if (cs->pub.state == CONN_STATE_SUSPENDED) { apr_atomic_inc32(&suspended_count); -- 2.40.0