From 88e5f7cc408f14b53dd654e6fee006d3458335ff Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 26 Nov 2013 17:11:51 +0000 Subject: [PATCH] Follow-up to r1538490: Ensure that conn_rec->sbh is always cleared when returning from process_socket(). git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1545736 13f79535-47bb-0310-9956-ffa450edef68 --- server/mpm/event/event.c | 5 ++++- server/mpm/eventopt/eventopt.c | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/server/mpm/event/event.c b/server/mpm/event/event.c index 7aceeeca54..d36abbc64b 100644 --- a/server/mpm/event/event.c +++ b/server/mpm/event/event.c @@ -1028,6 +1028,7 @@ read_request: * event thread poll for writeability. */ cs->expiration_time = ap_server_conf->timeout + apr_time_now(); + c->sbh = NULL; apr_thread_mutex_lock(timeout_mutex); TO_QUEUE_APPEND(write_completion_q, cs); cs->pfd.reqevents = ( @@ -1052,8 +1053,10 @@ read_request: } if (cs->pub.state == CONN_STATE_LINGER) { - if (!start_lingering_close_blocking(cs)) + if (!start_lingering_close_blocking(cs)) { + c->sbh = NULL; return; + } } else if (cs->pub.state == CONN_STATE_CHECK_REQUEST_LINE_READABLE) { /* It greatly simplifies the logic to use a single timeout value here diff --git a/server/mpm/eventopt/eventopt.c b/server/mpm/eventopt/eventopt.c index 000f265de3..0cdbc34c05 100644 --- a/server/mpm/eventopt/eventopt.c +++ b/server/mpm/eventopt/eventopt.c @@ -1080,6 +1080,7 @@ read_request: pollset_op_t *v = ap_equeue_writer_value(eq); cs->expiration_time = ap_server_conf->timeout + apr_time_now(); + c->sbh = NULL; cs->pfd.reqevents = ( cs->pub.sense == CONN_SENSE_WANT_READ ? APR_POLLIN : APR_POLLOUT) | APR_POLLHUP | APR_POLLERR; @@ -1108,6 +1109,7 @@ read_request: if (cs->pub.state == CONN_STATE_LINGER) { if (!start_lingering_close_blocking(cs, eq)) { + c->sbh = NULL; return; } } -- 2.40.0