httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject svn commit: r329664 - in /httpd/httpd/trunk: modules/http/http_core.c server/eor_bucket.c
Date Sun, 30 Oct 2005 22:55:37 GMT
Author: brianp
Date: Sun Oct 30 14:55:35 2005
New Revision: 329664

URL: http://svn.apache.org/viewcvs?rev=329664&view=rev
Log:
Moved the extended_status scoreboard update from ap_process_http_connection
to the EOR bucket destructor.  Also, added some defensive code and comments
regarding r->pool lifetime to ap_process_http_connection.

Modified:
    httpd/httpd/trunk/modules/http/http_core.c
    httpd/httpd/trunk/server/eor_bucket.c

Modified: httpd/httpd/trunk/modules/http/http_core.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/http/http_core.c?rev=329664&r1=329663&r2=329664&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http/http_core.c (original)
+++ httpd/httpd/trunk/modules/http/http_core.c Sun Oct 30 14:55:35 2005
@@ -125,11 +125,16 @@
             if (r->status == HTTP_OK) {
                 cs->state = CONN_STATE_HANDLER;
                 ap_process_async_request(r);
+                /* After the call to ap_process_request, the
+                 * request pool may have been deleted.  We set
+                 * r=NULL here to ensure that any dereference
+                 * of r that might be added later in this function
+                 * will result in a segfault immediately instead
+                 * of nondeterministic failures later.
+                 */
+                r = NULL;
             }
 
-            if (ap_extended_status)
-                ap_increment_counts(c->sbh, r);
-
             if (cs->state != CONN_STATE_WRITE_COMPLETION) {
                 /* Something went wrong; close the connection */
                 cs->state = CONN_STATE_LINGER;
@@ -164,15 +169,20 @@
         if (r->status == HTTP_OK) {
             cs->state = CONN_STATE_HANDLER;
             ap_process_request(r);
+            /* After the call to ap_process_request, the
+             * request pool will have been deleted.  We set
+             * r=NULL here to ensure that any dereference
+             * of r that might be added later in this function
+             * will result in a segfault immediately instead
+             * of nondeterministic failures later.
+             */
+            r = NULL;
         }
- 
-        if (ap_extended_status)
-            ap_increment_counts(c->sbh, r);
- 
+
         if (c->keepalive != AP_CONN_KEEPALIVE || c->aborted)
             break;
  
-        ap_update_child_status(c->sbh, SERVER_BUSY_KEEPALIVE, r);
+        ap_update_child_status(c->sbh, SERVER_BUSY_KEEPALIVE, NULL);
  
         if (ap_graceful_stop_signalled())
             break;

Modified: httpd/httpd/trunk/server/eor_bucket.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/server/eor_bucket.c?rev=329664&r1=329663&r2=329664&view=diff
==============================================================================
--- httpd/httpd/trunk/server/eor_bucket.c (original)
+++ httpd/httpd/trunk/server/eor_bucket.c Sun Oct 30 14:55:35 2005
@@ -17,6 +17,7 @@
 #include "httpd.h"
 #include "http_request.h"
 #include "http_protocol.h"
+#include "scoreboard.h"
 
 static apr_status_t eor_bucket_read(apr_bucket *b, const char **str, 
                                     apr_size_t *len, apr_read_type_e block)
@@ -52,6 +53,9 @@
     request_rec *r = (request_rec *)data;
     if (r != NULL) {
         ap_run_log_transaction(r);
+        if (ap_extended_status) {
+            ap_increment_counts(r->connection->sbh, r);
+        }
         apr_pool_destroy(r->pool);
     }
 }



Mime
View raw message