httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r1448148 - /httpd/httpd/trunk/server/mpm/eventopt/eventopt.c
Date Wed, 20 Feb 2013 13:11:29 GMT
Author: jim
Date: Wed Feb 20 13:11:29 2013
New Revision: 1448148

URL: http://svn.apache.org/r1448148
Log:
resync w/ some event fixes

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

Modified: httpd/httpd/trunk/server/mpm/eventopt/eventopt.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/eventopt/eventopt.c?rev=1448148&r1=1448147&r2=1448148&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/eventopt/eventopt.c (original)
+++ httpd/httpd/trunk/server/mpm/eventopt/eventopt.c Wed Feb 20 13:11:29 2013
@@ -173,7 +173,7 @@ static int dying = 0;
 static int workers_may_exit = 0;
 static int start_thread_may_exit = 0;
 static int listener_may_exit = 0;
-static int requests_this_child;
+static int conns_this_child;
 static int num_listensocks = 0;
 static apr_uint32_t connection_count = 0;
 static int resource_shortage = 0;
@@ -808,10 +808,6 @@ static int start_lingering_close(event_c
 {
     apr_status_t rv;
 
-    cs->c->sbh = NULL;  /* prevent scoreboard updates from the listener 
-                         * worker will loop around soon and set SERVER_READY
-                         */
-
     if (ap_start_lingering_close(cs->c)) {
         apr_pool_clear(cs->p);
         ap_push_pool(worker_queue_info, cs->p);
@@ -1064,10 +1060,19 @@ read_request:
         ap_equeue_writer_onward(eq);
         apr_pollset_wakeup(event_pollset);
     }
+
+    /*
+     * Prevent this connection from writing to our connection state after it
+     * is no longer associated with this thread. This would happen if the EOR
+     * bucket is destroyed from the listener thread due to a connection abort
+     * or timeout.
+     */
+    c->sbh = NULL;
+
     return 1;
 }
 
-/* requests_this_child has gone to zero or below.  See if the admin coded
+/* conns_this_child has gone to zero or below.  See if the admin coded
    "MaxConnectionsPerChild 0", and keep going in that case.  Doing it this way
    simplifies the hot path in worker_thread */
 static void check_infinite_requests(void)
@@ -1076,7 +1081,7 @@ static void check_infinite_requests(void
         signal_threads(ST_GRACEFUL);
     }
     else {
-        requests_this_child = INT_MAX;  /* keep going */
+        conns_this_child = INT_MAX;  /* keep going */
     }
 }
 
@@ -1457,7 +1462,7 @@ static void * APR_THREAD_FUNC listener_t
                 break;
         }
 
-        if (requests_this_child <= 0) {
+        if (conns_this_child <= 0) {
             check_infinite_requests();
         }
 
@@ -1865,7 +1870,7 @@ static void *APR_THREAD_FUNC worker_thre
             worker_sockets[thread_slot] = csd;
             rv = process_socket(thd, ptrans, csd, cs, eq, process_slot, thread_slot);
             if (!rv) {
-                requests_this_child--;
+                conns_this_child--;
             }
             worker_sockets[thread_slot] = NULL;
         }
@@ -2202,11 +2207,11 @@ static void child_main(int child_num_arg
     }
 
     if (ap_max_requests_per_child) {
-        requests_this_child = ap_max_requests_per_child;
+        conns_this_child = ap_max_requests_per_child;
     }
     else {
         /* coding a value of zero means infinity */
-        requests_this_child = INT_MAX;
+        conns_this_child = INT_MAX;
     }
 
     /* Setup worker threads */



Mime
View raw message