You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by sf...@apache.org on 2010/03/17 20:59:56 UTC

svn commit: r924452 - /httpd/httpd/trunk/modules/filters/mod_sed.c

Author: sf
Date: Wed Mar 17 19:59:56 2010
New Revision: 924452

URL: http://svn.apache.org/viewvc?rev=924452&view=rev
Log:
Correctly handle the case where apr_brigade_partition() returns APR_INCOMPLETE
and b points to the sentinel of ctx->proc_bb and not the sentinel of bb.
(Similar fix as r910326)

Modified:
    httpd/httpd/trunk/modules/filters/mod_sed.c

Modified: httpd/httpd/trunk/modules/filters/mod_sed.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/filters/mod_sed.c?rev=924452&r1=924451&r2=924452&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/filters/mod_sed.c (original)
+++ httpd/httpd/trunk/modules/filters/mod_sed.c Wed Mar 17 19:59:56 2010
@@ -478,11 +478,13 @@ static apr_status_t sed_request_filter(a
     if (!APR_BRIGADE_EMPTY(ctx->bb)) {
         apr_bucket *b = NULL;
 
-        /* This may return APR_INCOMPLETE which should be fine */
-        apr_brigade_partition(ctx->bb, readbytes, &b);
-
-        APR_BRIGADE_CONCAT(bb, ctx->bb);
-        apr_brigade_split_ex(bb, b, ctx->bb);
+        if (apr_brigade_partition(ctx->bb, readbytes, &b) == APR_INCOMPLETE) {
+            APR_BRIGADE_CONCAT(bb, ctx->bb);
+        }
+        else {
+            APR_BRIGADE_CONCAT(bb, ctx->bb);
+            apr_brigade_split_ex(bb, b, ctx->bb);
+        }
     }
     return APR_SUCCESS;
 }