]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mpm_event: follow up to r1639614.
authorYann Ylavic <ylavic@apache.org>
Tue, 2 Dec 2014 13:41:14 +0000 (13:41 +0000)
committerYann Ylavic <ylavic@apache.org>
Tue, 2 Dec 2014 13:41:14 +0000 (13:41 +0000)
Notify suspend in any case when starting lingering close (blocking),
and outside the lingering queue's critical section.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1642868 13f79535-47bb-0310-9956-ffa450edef68

server/mpm/event/event.c

index 4635a2e5245dbcb20684aa37e7344e68172d1705..32e6e53f5bf6c5bd47419c4effec4597112f90f9 100644 (file)
@@ -859,16 +859,16 @@ 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);
-    apr_thread_mutex_lock(timeout_mutex);
     cs->c->sbh = NULL;
+    if (in_worker) { 
+        notify_suspend(cs);
+    }
+    apr_thread_mutex_lock(timeout_mutex);
     TO_QUEUE_APPEND(*q, cs);
     cs->pfd.reqevents = (
             cs->pub.sense == CONN_SENSE_WANT_WRITE ? APR_POLLOUT :
                     APR_POLLIN) | APR_POLLHUP | APR_POLLERR;
     cs->pub.sense = CONN_SENSE_DEFAULT;
-    if (in_worker) { 
-        notify_suspend(cs);
-    }
     rv = apr_pollset_add(event_pollset, &cs->pfd);
     apr_thread_mutex_unlock(timeout_mutex);
     if (rv != APR_SUCCESS && !APR_STATUS_IS_EEXIST(rv)) {
@@ -895,6 +895,8 @@ 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;
     }