You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Jeff Trawick <tr...@gmail.com> on 2012/01/20 14:56:28 UTC

Re: svn commit: r1233882 - /httpd/httpd/trunk/server/core_filters.c

On Fri, Jan 20, 2012 at 7:41 AM,  <jo...@apache.org> wrote:
> Author: jorton
> Date: Fri Jan 20 12:41:18 2012
> New Revision: 1233882
>
> URL: http://svn.apache.org/viewvc?rev=1233882&view=rev
> Log:
> * server/core_filters.c (ap_core_input_filter): Only treat EAGAIN as
>  success if a non-blocking read was requested; for a blocking read,
>  it is an error condition.

In case anyone remembers:  Is this the same area discussed by
Jim+Joe+Jeff at AC2011 based on Jim's Jenkins testcase?

>
> Modified:
>    httpd/httpd/trunk/server/core_filters.c
>
> Modified: httpd/httpd/trunk/server/core_filters.c
> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/core_filters.c?rev=1233882&r1=1233881&r2=1233882&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/server/core_filters.c (original)
> +++ httpd/httpd/trunk/server/core_filters.c Fri Jan 20 12:41:18 2012
> @@ -137,7 +137,7 @@ int ap_core_input_filter(ap_filter_t *f,
>          * empty).  We do this by returning whatever we have read.  This may
>          * or may not be bogus, but is consistent (for now) with EOF logic.
>          */
> -        if (APR_STATUS_IS_EAGAIN(rv)) {
> +        if (APR_STATUS_IS_EAGAIN(rv) && block == APR_NONBLOCK_READ) {
>             rv = APR_SUCCESS;
>         }
>         return rv;
> @@ -223,7 +223,9 @@ int ap_core_input_filter(ap_filter_t *f,
>         e = APR_BRIGADE_FIRST(ctx->b);
>         rv = apr_bucket_read(e, &str, &len, block);
>
> -        if (APR_STATUS_IS_EAGAIN(rv)) {
> +        if (APR_STATUS_IS_EAGAIN(rv) && block == APR_NONBLOCK_READ) {
> +            /* getting EAGAIN for a blocking read is an error; for a
> +             * non-blocking read, return an empty brigade. */
>             return APR_SUCCESS;
>         }
>         else if (rv != APR_SUCCESS) {
>
>



-- 
Born in Roswell... married an alien...

Re: svn commit: r1233882 - /httpd/httpd/trunk/server/core_filters.c

Posted by Joe Orton <jo...@redhat.com>.
On Fri, Jan 20, 2012 at 08:56:28AM -0500, Jeff Trawick wrote:
> On Fri, Jan 20, 2012 at 7:41 AM,  <jo...@apache.org> wrote:
> > Author: jorton
> > Date: Fri Jan 20 12:41:18 2012
> > New Revision: 1233882
> >
> > URL: http://svn.apache.org/viewvc?rev=1233882&view=rev
> > Log:
> > * server/core_filters.c (ap_core_input_filter): Only treat EAGAIN as
> >  success if a non-blocking read was requested; for a blocking read,
> >  it is an error condition.
> 
> In case anyone remembers:  Is this the same area discussed by
> Jim+Joe+Jeff at AC2011 based on Jim's Jenkins testcase?

I was reading that code for PR 52476.

I just re-read that thread on Jenkins.  I am not convinced by the 
comments in get_remaining_chunk_line().  This:

    if (lineend[len - 1] != APR_ASCII_LF) {
        return APR_EAGAIN;
    }

looks suspect.  If the server sent a few bytes of chunk-line (*no* LF) 
then closed the socket, we'd hit that condition and should fail with an 
error, not EAGAIN.  Possibly.  I'll try some test cases.