httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yann Ylavic <ylavic....@gmail.com>
Subject Re: PR56729: reqtimeout bug with fast response and slow POST
Date Wed, 19 Nov 2014 09:26:00 GMT
On Sat, Aug 30, 2014 at 3:19 PM, Yann Ylavic <ylavic.dev@gmail.com> wrote:
> On Sat, Aug 30, 2014 at 3:02 PM, Eric Covener <covener@gmail.com> wrote:
>> On Tue, Aug 26, 2014 at 5:22 AM, Yann Ylavic <ylavic.dev@gmail.com> wrote:
>>> I don't think mod_reqtimeout should handle/count speculative bytes,
>>> they ought to be read for real later (and taken into account then).
>>> Otherwise, the same bytes may be counted multiple times.
>>>
>>> How about simply forward the ap_get_brigade() call?
>>
>> Makes sense --  I did limit it to nonblock as well. Can you take a
>> look before I propose? http://svn.apache.org/r1621453
>
> I'm not sure we should limit it to nonblock, speculative mode is
> mainly to be used in non-blocking, but ap_rgetline_core() for example
> does not (when folding), so mod_reqtimeout may still count header
> bytes twice.

Eric, Jeff, since you already voted for r1621453 in 2.4.x/STATUS, how
about this additional patch?
As said above, IMHO we really shouldn't count any speculative bytes in
mod_reqtimeout (nonblocking or not), relevant data should be asked
"for real" soon or later.

Index: modules/filters/mod_reqtimeout.c
===================================================================
--- modules/filters/mod_reqtimeout.c    (revision 1640032)
+++ modules/filters/mod_reqtimeout.c    (working copy)
@@ -183,12 +183,13 @@ static apr_status_t reqtimeout_filter(ap_filter_t
         return ap_get_brigade(f->next, bb, mode, block, readbytes);
     }

-    if (block == APR_NONBLOCK_READ && mode == AP_MODE_SPECULATIVE) {
+    if (mode == AP_MODE_SPECULATIVE) {
         /*  The source of these above us in the core is check_pipeline(), which
          *  is between requests but before this filter knows to reset timeouts
-         *  during log_transaction().  If they appear elsewhere, just don't
-         *  check or extend the time since they won't block and we'll see the
-         *  bytes again later
+         *  during log_transaction(), or ap_rgetline_core() to handle headers'
+         *  folding (next char prefetch).  Likewise, if they appear elsewhere,
+         *  just don't check or extend the time since we should see the
+         *  relevant bytes again later.
          */
         return ap_get_brigade(f->next, bb, mode, block, readbytes);
     }
>
> Regards,
> Yann.

Mime
View raw message