]> granicus.if.org Git - apache/commitdiff
Follow up to r1734656: restore c->data_in_input_filters usage to
authorYann Ylavic <ylavic@apache.org>
Tue, 22 Mar 2016 17:08:29 +0000 (17:08 +0000)
committerYann Ylavic <ylavic@apache.org>
Tue, 22 Mar 2016 17:08:29 +0000 (17:08 +0000)
see if it helps unblocking test framework.

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

include/httpd.h
modules/http/http_request.c
server/mpm/event/event.c
server/mpm/motorz/motorz.c
server/mpm/simple/simple_io.c
server/util_filter.c

index 44a8ac42806a9211cfb8c94b1e7ede961cf0d87c..585a89d5e36a16d6b5e8ec3c72a83848c7c46ac1 100644 (file)
@@ -1151,7 +1151,7 @@ struct conn_rec {
     struct apr_bucket_alloc_t *bucket_alloc;
     /** The current state of this connection; may be NULL if not used by MPM */
     conn_state_t *cs;
-    /** No longer used, replaced with ap_filter_input_pending() */
+    /** Is there data pending in the input filters or connection? */
     int data_in_input_filters;
     /** No longer used, replaced with ap_filter_should_yield() */
     int data_in_output_filters;
index 17051eef63129111ec63ff5d9e9f923ca6b79ec4..ee50b4232a7d6179afff7cb390489118d0b68239 100644 (file)
@@ -237,6 +237,7 @@ static void check_pipeline(conn_rec *c, apr_bucket_brigade *bb)
     apr_size_t cr = 0;
     char buf[2];
 
+    c->data_in_input_filters = 0;
     while (c->keepalive != AP_CONN_CLOSE && !c->aborted) {
         apr_size_t len = cr + 1;
 
@@ -276,6 +277,7 @@ static void check_pipeline(conn_rec *c, apr_bucket_brigade *bb)
                  * where this possible failure comes from (metadata,
                  * morphed EOF socket => empty bucket? debug only here).
                  */
+                c->data_in_input_filters = 1;
                 log_level = APLOG_DEBUG;
             }
             ap_log_cerror(APLOG_MARK, log_level, rv, c, APLOGNO(02968)
@@ -294,6 +296,7 @@ static void check_pipeline(conn_rec *c, apr_bucket_brigade *bb)
                 num_blank_lines--;
             }
             else {
+                c->data_in_input_filters = 1;
                 break;
             }
         }
@@ -306,6 +309,7 @@ static void check_pipeline(conn_rec *c, apr_bucket_brigade *bb)
                 cr = 1;
             }
             else {
+                c->data_in_input_filters = 1;
                 break;
             }
         }
@@ -449,7 +453,7 @@ AP_DECLARE(void) ap_process_request(request_rec *r)
 
     ap_process_async_request(r);
 
-    if (ap_run_input_pending(c) != OK) {
+    if (!c->data_in_input_filters || ap_run_input_pending(c) != OK) {
         bb = apr_brigade_create(c->pool, c->bucket_alloc);
         b = apr_bucket_flush_create(c->bucket_alloc);
         APR_BRIGADE_INSERT_HEAD(bb, b);
index 8e1e156d4030926d9f910052e3f57e271a86e0d5..6648331661d4583ffa4fbf597efd73a3bec90e50 100644 (file)
@@ -1179,7 +1179,7 @@ read_request:
             listener_may_exit) {
             cs->pub.state = CONN_STATE_LINGER;
         }
-        else if (ap_run_input_pending(c) == OK) {
+        else if (c->data_in_input_filters || ap_run_input_pending(c) == OK) {
             cs->pub.state = CONN_STATE_READ_REQUEST_LINE;
             goto read_request;
         }
index 1f5453ef43c841510f05f121c7681104c4a19d93..c1f90c37eada83bab3820e693308aa906e54825a 100644 (file)
@@ -433,7 +433,7 @@ read_request:
             else if (c->keepalive != AP_CONN_KEEPALIVE || c->aborted) {
                 scon->cs.state = CONN_STATE_LINGER;
             }
-            else if (ap_run_input_pending(c) == OK) {
+            else if (c->data_in_input_filters || ap_run_input_pending(c) == OK) {
                 scon->cs.state = CONN_STATE_READ_REQUEST_LINE;
                 goto read_request;
             }
index dcd1c75d84cd10636c5e6f19debfae5ab80f13b1..d06642cb491824a6f9b5e90c4a711cdc1b9824db 100644 (file)
@@ -133,7 +133,7 @@ static apr_status_t simple_io_process(simple_conn_t * scon)
             else if (c->keepalive != AP_CONN_KEEPALIVE || c->aborted) {
                 scon->cs.state = CONN_STATE_LINGER;
             }
-            else if (ap_run_input_pending(c) == OK) {
+            else if (c->data_in_input_filters || ap_run_input_pending(c) == OK) {
                 scon->cs.state = CONN_STATE_READ_REQUEST_LINE;
             }
             else {
index b3ea895b9503f6ceafd0eb1fa25ef5a7c3bbbd53..b392ff2722ec2bab0db1a6e45a40c480d97df830 100644 (file)
@@ -713,9 +713,8 @@ AP_DECLARE(int) ap_filter_prepare_brigade(ap_filter_t *f, apr_pool_t **p)
 
         pool = f->r ? f->r->pool : f->c->pool;
 
-        key = apr_palloc(pool, sizeof(ap_filter_t **));
-        *key = f;
-        apr_hash_set(f->c->filters, key, sizeof(ap_filter_t **), f);
+        key = apr_pmemdup(pool, &f, sizeof f);
+        apr_hash_set(f->c->filters, key, sizeof key, f);
 
         f->bb = apr_brigade_create(pool, f->c->bucket_alloc);