httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Plüm, Rüdiger, Vodafone Group <ruediger.pl...@vodafone.com>
Subject RE: svn commit: r1484852 - in /httpd/httpd/trunk: CHANGES modules/http/http_filters.c
Date Wed, 22 May 2013 13:53:51 GMT


From: Yann Ylavic [mailto:ylavic.dev@gmail.com]
Sent: Mittwoch, 22. Mai 2013 13:06
To: dev@httpd.apache.org
Subject: Re: svn commit: r1484852 - in /httpd/httpd/trunk: CHANGES modules/http/http_filters.c

On 05/14/2013 08:58 PM, minfrin@apache.org<mailto:minfrin@apache.org> 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.

Mime
View raw message