You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by yl...@apache.org on 2016/03/22 18:08:30 UTC

svn commit: r1736216 - in /httpd/httpd/trunk: 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

Author: ylavic
Date: Tue Mar 22 17:08:29 2016
New Revision: 1736216

URL: http://svn.apache.org/viewvc?rev=1736216&view=rev
Log:
Follow up to r1734656: restore c->data_in_input_filters usage to
see if it helps unblocking test framework.

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

Modified: httpd/httpd/trunk/include/httpd.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/httpd.h?rev=1736216&r1=1736215&r2=1736216&view=diff
==============================================================================
--- httpd/httpd/trunk/include/httpd.h (original)
+++ httpd/httpd/trunk/include/httpd.h Tue Mar 22 17:08:29 2016
@@ -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;

Modified: httpd/httpd/trunk/modules/http/http_request.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http/http_request.c?rev=1736216&r1=1736215&r2=1736216&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http/http_request.c (original)
+++ httpd/httpd/trunk/modules/http/http_request.c Tue Mar 22 17:08:29 2016
@@ -237,6 +237,7 @@ static void check_pipeline(conn_rec *c,
     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,
                  * 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,
                 num_blank_lines--;
             }
             else {
+                c->data_in_input_filters = 1;
                 break;
             }
         }
@@ -306,6 +309,7 @@ static void check_pipeline(conn_rec *c,
                 cr = 1;
             }
             else {
+                c->data_in_input_filters = 1;
                 break;
             }
         }
@@ -449,7 +453,7 @@ AP_DECLARE(void) ap_process_request(requ
 
     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);

Modified: httpd/httpd/trunk/server/mpm/event/event.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/event/event.c?rev=1736216&r1=1736215&r2=1736216&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/event/event.c (original)
+++ httpd/httpd/trunk/server/mpm/event/event.c Tue Mar 22 17:08:29 2016
@@ -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;
         }

Modified: httpd/httpd/trunk/server/mpm/motorz/motorz.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/motorz/motorz.c?rev=1736216&r1=1736215&r2=1736216&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/motorz/motorz.c (original)
+++ httpd/httpd/trunk/server/mpm/motorz/motorz.c Tue Mar 22 17:08:29 2016
@@ -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;
             }

Modified: httpd/httpd/trunk/server/mpm/simple/simple_io.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/simple/simple_io.c?rev=1736216&r1=1736215&r2=1736216&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/simple/simple_io.c (original)
+++ httpd/httpd/trunk/server/mpm/simple/simple_io.c Tue Mar 22 17:08:29 2016
@@ -133,7 +133,7 @@ static apr_status_t simple_io_process(si
             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 {

Modified: httpd/httpd/trunk/server/util_filter.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/util_filter.c?rev=1736216&r1=1736215&r2=1736216&view=diff
==============================================================================
--- httpd/httpd/trunk/server/util_filter.c (original)
+++ httpd/httpd/trunk/server/util_filter.c Tue Mar 22 17:08:29 2016
@@ -713,9 +713,8 @@ AP_DECLARE(int) ap_filter_prepare_brigad
 
         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);
 



Re: svn commit: r1736216 - in /httpd/httpd/trunk: 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

Posted by Jim Jagielski <ji...@jaguNET.com>.
> On Mar 22, 2016, at 9:11 PM, Graham Leggett <mi...@sharp.fm> wrote:
> 
> On 22 Mar 2016, at 7:08 PM, ylavic@apache.org wrote:
> 
>> URL: http://svn.apache.org/viewvc?rev=1736216&view=rev
>> Log:
>> Follow up to r1734656: restore c->data_in_input_filters usage to
>> see if it helps unblocking test framework.
> 
> I created an almost identical patch before doing an update, the only difference was this:
> 
> Index: modules/http/http_request.c
> ===================================================================
> --- modules/http/http_request.c	(revision 1736263)
> +++ modules/http/http_request.c	(working copy)
> @@ -453,7 +453,7 @@
> 
>     ap_process_async_request(r);
> 
> -    if (!c->data_in_input_filters || 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);
> 
> I get hangs without the above patch on the test suite, but it runs clean with. Can you give it a try?
> 

d'oh!!

+1!


Re: svn commit: r1736216 - in /httpd/httpd/trunk: 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

Posted by Yann Ylavic <yl...@gmail.com>.
On Wed, Mar 23, 2016 at 2:11 AM, Graham Leggett <mi...@sharp.fm> wrote:
> On 22 Mar 2016, at 7:08 PM, ylavic@apache.org wrote:
>
>> URL: http://svn.apache.org/viewvc?rev=1736216&view=rev
>> Log:
>> Follow up to r1734656: restore c->data_in_input_filters usage to
>> see if it helps unblocking test framework.
>
> I created an almost identical patch before doing an update, the only difference was this:
>
> Index: modules/http/http_request.c
> ===================================================================
> --- modules/http/http_request.c (revision 1736263)
> +++ modules/http/http_request.c (working copy)
> @@ -453,7 +453,7 @@
>
>      ap_process_async_request(r);
>
> -    if (!c->data_in_input_filters || 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);
>
> I get hangs without the above patch on the test suite, but it runs clean with. Can you give it a try?

Yes this is the right logic.
I wonder how the hook can return anything but DECLINED though, I see
no registering in our code.

Unfortunately I can't reproduce the issue on my system(s), so testing
is good, but it was already...

Regards,
Yann.

Re: svn commit: r1736216 - in /httpd/httpd/trunk: 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

Posted by Graham Leggett <mi...@sharp.fm>.
On 22 Mar 2016, at 7:08 PM, ylavic@apache.org wrote:

> URL: http://svn.apache.org/viewvc?rev=1736216&view=rev
> Log:
> Follow up to r1734656: restore c->data_in_input_filters usage to
> see if it helps unblocking test framework.

I created an almost identical patch before doing an update, the only difference was this:

Index: modules/http/http_request.c
===================================================================
--- modules/http/http_request.c	(revision 1736263)
+++ modules/http/http_request.c	(working copy)
@@ -453,7 +453,7 @@
 
     ap_process_async_request(r);
 
-    if (!c->data_in_input_filters || 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);

I get hangs without the above patch on the test suite, but it runs clean with. Can you give it a try?

Regards,
Graham
—