You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by yl...@apache.org on 2015/03/01 01:44:50 UTC

svn commit: r1663017 - /httpd/httpd/trunk/server/mpm/event/event.c

Author: ylavic
Date: Sun Mar  1 00:44:49 2015
New Revision: 1663017

URL: http://svn.apache.org/r1663017
Log:
mpm_event: follow up to r1538490, r1545736, r1604350, r1639614 and r1642868.
Clear and restore sbh in notify_suspend() and notify_resume() respectively.

Modified:
    httpd/httpd/trunk/server/mpm/event/event.c

Modified: httpd/httpd/trunk/server/mpm/event/event.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/event/event.c?rev=1663017&r1=1663016&r2=1663017&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/event/event.c (original)
+++ httpd/httpd/trunk/server/mpm/event/event.c Sun Mar  1 00:44:49 2015
@@ -820,10 +820,12 @@ static void notify_suspend(event_conn_st
 {
     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(
         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(
 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(v
     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
     }
     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);
     }
 }