You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by br...@apache.org on 2005/10/24 00:21:04 UTC

svn commit: r327870 - in /httpd/httpd/trunk: CHANGES include/httpd.h modules/http/http_core.c server/core.c

Author: brianp
Date: Sun Oct 23 15:20:59 2005
New Revision: 327870

URL: http://svn.apache.org/viewcvs?rev=327870&view=rev
Log:
Add new connection states for handler and write completion
(backport from async-dev branch to 2.3 trunk)

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/include/httpd.h
    httpd/httpd/trunk/modules/http/http_core.c
    httpd/httpd/trunk/server/core.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/CHANGES?rev=327870&r1=327869&r2=327870&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Sun Oct 23 15:20:59 2005
@@ -2,6 +2,9 @@
 Changes with Apache 2.3.0
   [Remove entries to the current 2.0 and 2.2 section below, when backported]
 
+  *) Added new connection states for handler and write completion
+     [Brian Pane]
+
   *) mod_proxy_ajp: Do not spool the entire response from AJP backend before
      sending it up the filter chain. PR37100.  [Ruediger Pluem]
 

Modified: httpd/httpd/trunk/include/httpd.h
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/include/httpd.h?rev=327870&r1=327869&r2=327870&view=diff
==============================================================================
--- httpd/httpd/trunk/include/httpd.h (original)
+++ httpd/httpd/trunk/include/httpd.h Sun Oct 23 15:20:59 2005
@@ -1074,6 +1074,8 @@
 typedef enum  {
     CONN_STATE_CHECK_REQUEST_LINE_READABLE,
     CONN_STATE_READ_REQUEST_LINE,
+    CONN_STATE_HANDLER,
+    CONN_STATE_WRITE_COMPLETION,
     CONN_STATE_LINGER,
 } conn_state_e;
 

Modified: httpd/httpd/trunk/modules/http/http_core.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/http/http_core.c?rev=327870&r1=327869&r2=327870&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http/http_core.c (original)
+++ httpd/httpd/trunk/modules/http/http_core.c Sun Oct 23 15:20:59 2005
@@ -135,10 +135,12 @@
             else if (!c->data_in_input_filters) {
                 cs->state = CONN_STATE_CHECK_REQUEST_LINE_READABLE;
             }
-
-            /* else we are pipelining.  Stay in READ_REQUEST_LINE state
-             *  and stay in the loop
-             */
+            else {
+                /* else we are pipelining.  Stay in READ_REQUEST_LINE state
+                 *  and stay in the loop
+                 */
+                cs->state = CONN_STATE_READ_REQUEST_LINE;
+            }
 
             apr_pool_destroy(r->pool);
         }
@@ -153,6 +155,7 @@
 static int ap_process_http_connection(conn_rec *c)
 {
     request_rec *r;
+    conn_state_t *cs = c->cs;
     apr_socket_t *csd = NULL;
 
     /*
@@ -167,8 +170,10 @@
         /* process the request if it was read without error */
  
         ap_update_child_status(c->sbh, SERVER_BUSY_WRITE, r);
-        if (r->status == HTTP_OK)
+        if (r->status == HTTP_OK) {
+            cs->state = CONN_STATE_HANDLER;
             ap_process_request(r);
+        }
  
         if (ap_extended_status)
             ap_increment_counts(c->sbh, r);

Modified: httpd/httpd/trunk/server/core.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/server/core.c?rev=327870&r1=327869&r2=327870&view=diff
==============================================================================
--- httpd/httpd/trunk/server/core.c (original)
+++ httpd/httpd/trunk/server/core.c Sun Oct 23 15:20:59 2005
@@ -3809,6 +3809,14 @@
     c->id = id;
     c->bucket_alloc = alloc;
 
+    c->cs = (conn_state_t *)apr_pcalloc(ptrans, sizeof(conn_state_t));
+    APR_RING_INIT(&(c->cs->timeout_list), conn_state_t, timeout_list);
+    c->cs->expiration_time = 0;
+    c->cs->state = CONN_STATE_CHECK_REQUEST_LINE_READABLE;
+    c->cs->c = c;
+    c->cs->p = ptrans;
+    c->cs->bucket_alloc = alloc;
+
     return c;
 }