From: Yann Ylavic [mailto:[email protected]]
Sent: Mittwoch, 22. Mai 2013 13:06
To: [email protected]
Subject: Re: svn commit: r1484852 - in /httpd/httpd/trunk: CHANGES 
modules/http/http_filters.c

On 05/14/2013 08:58 PM, [email protected]<mailto:[email protected]> wrote:
> Author: minfrin
> Date: Tue May 21 16:10:02 2013
> New Revision: 1484852
>
> URL: http://svn.apache.org/r1484852
> Log:
> core: Remove apr_brigade_flatten(), buffering and duplicated code
> from the HTTP_IN filter, parse chunks in a single pass with zero copy.
> Reduce memory usage by 48 bytes per request.
>
> Modified:
> httpd/httpd/trunk/CHANGES
> httpd/httpd/trunk/modules/http/http_filters.c
Shouldn't the BODY_CHUNK_END state only accept [CR]LF ?
Currently anything but a LF is ignored.

Index: modules/http/http_filters.c
===================================================================
--- modules/http/http_filters.c    (revision 1485126)
+++ modules/http/http_filters.c    (working copy)
@@ -100,9 +100,15 @@

         /* handle CRLF after the chunk */
         if (ctx->state == BODY_CHUNK_END) {
-            if (c == LF) {
-                ctx->state = BODY_CHUNK;
+            if (c == CR && ++i < len) {
+                c = buffer[i];
+                ap_xlate_proto_from_ascii(&c, 1);
             }
+            if (c != LF) {
+                /* [CR]LF expected! */
+                return APR_EGENERAL;
+            }
+            ctx->state = BODY_CHUNK;
             i++;
             continue;
         }
Regards,
Yann.

Reply via email to