Joe Schaefer wrote:

>There's also a refcount problem in http_protocol.c wrt chunked
>transfer codings. The problem is that the bucket holding the
>chunk size isn't ever freed, so the corresponding data block
>is overcounted.
>
>Here's a diff for http_protocol.c against current anon-cvs (which
>doesn't seem to have any of the newer changes to ap_get_client_block).
>Light testing seems to indicate that this fixes the refcount problem.
>

Thanks, I'll commit this now.  I've applied a slightly simplified
form of this change: clearing the brigade right after the 
apr_brigade_flatten
regardless of the return code.

I think there may be a couple of other bucket leaks in that same
file; I'll scan through it and fix any other leaks I can find.

Brian

>diff -u -r1.454 http_protocol.c
>--- http_protocol.c     13 Aug 2002 14:27:39 -0000      1.454
>+++ http_protocol.c     5 Sep 2002 17:15:12 -0000
>@@ -901,6 +901,7 @@
>             if (rv == APR_SUCCESS) {
>                 rv = apr_brigade_flatten(bb, line, &len);
>                 if (rv == APR_SUCCESS) {
>+                    apr_brigade_cleanup(bb);
>                     ctx->remaining = get_chunk_size(line);
>                 }
>             }
>@@ -966,6 +967,7 @@
>                     if (rv == APR_SUCCESS) {
>                         rv = apr_brigade_flatten(bb, line, &len);
>                         if (rv == APR_SUCCESS) {
>+                            apr_brigade_cleanup(bb);
>                             ctx->remaining = get_chunk_size(line);
>                         }
>                     }
>  
>



Reply via email to