]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Add new connection states for handler and write completion
authorBrian Pane <brianp@apache.org>
Sun, 23 Oct 2005 22:20:59 +0000 (22:20 +0000)
committerBrian Pane <brianp@apache.org>
Sun, 23 Oct 2005 22:20:59 +0000 (22:20 +0000)
(backport from async-dev branch to 2.3 trunk)

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

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

diff --git a/CHANGES b/CHANGES
index 2d816f7a6e4d484ac53a485a9a8caeee2216d76b..106cf3e91dd77d07ffadbe79b406b3411c70f18b 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -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]
 
index 7f08b92d1dd39d9ae833634d4c5392ca36236356..0cb68df84719c9611582913947210306a6f02d21 100644 (file)
@@ -1074,6 +1074,8 @@ struct conn_rec {
 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;
 
index db0dc4fd158b56a7b8acc458d09fd80f280a137a..c74b3ef791a5b8cdaf1dca249c5e56914f3a1844 100644 (file)
@@ -135,10 +135,12 @@ static int ap_process_http_async_connection(conn_rec *c)
             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_async_connection(conn_rec *c)
 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 @@ static int ap_process_http_connection(conn_rec *c)
         /* 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);
index dc8adeffb8727f2c09d1cfb5eae406801f22f01f..9d2778acec0ed656de2539c5eaff1ac55f3f2c69 100644 (file)
@@ -3809,6 +3809,14 @@ static conn_rec *core_create_conn(apr_pool_t *ptrans, server_rec *server,
     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;
 }