httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Trawick" <traw...@gmail.com>
Subject Re: svn commit: r595954 - /httpd/httpd/trunk/modules/http/http_filters.c
Date Mon, 26 Nov 2007 15:38:28 GMT
On Nov 17, 2007 9:36 AM,  <niq@apache.org> wrote:
> Author: niq
> Date: Sat Nov 17 06:36:58 2007
> New Revision: 595954
>
> URL: http://svn.apache.org/viewvc?rev=595954&view=rev
> Log:
> Safer fix to PR43882 than in r595672.
>
> Modified:
>     httpd/httpd/trunk/modules/http/http_filters.c
>
> Modified: httpd/httpd/trunk/modules/http/http_filters.c
> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http/http_filters.c?rev=595954&r1=595953&r2=595954&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/modules/http/http_filters.c (original)
> +++ httpd/httpd/trunk/modules/http/http_filters.c Sat Nov 17 06:36:58 2007
> @@ -115,11 +115,11 @@
>          lenp = apr_table_get(f->r->headers_in, "Content-Length");
>
>          if (tenc) {
> -            /* RFC2616 allows qualifiers, so use strncasecmp */
> -            if (!strncasecmp(tenc, "chunked", 7) && !ap_strchr_c(tenc, ','))
{
> +            if (!strcasecmp(tenc, "chunked")) {
>                  ctx->state = BODY_CHUNK;
>              }
> -            else {
> +           /* test lenp, because it gives another case we can handle */
> +            else if (!lenp) {
>                  /* Something that isn't in HTTP, unless some future
>                   * edition defines new transfer ecodings, is unsupported.

The overall flow now looks like:

if Transfer-Encoding {
    if Transfer-Encoding == chunked {
        respect it
    }
    else if no Content-Length {
        log it and return an error
    }
    else {
        UNHANDLED case with unrecognized Transfer-Encoding as well as
Content-Length
    }
}
else if Content-Length {
    respect CL
}

What is the intention for the UNHANDLED case?    The code/comments
seem to imply we'll end up in the "respect CL" path.

Mime
View raw message