httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Fritsch ...@sfritsch.de>
Subject Re: Memory usage, core output filter, and apr_brigade_destroy
Date Sun, 04 Oct 2009 07:37:50 GMT
Thanks for your comments.

On Wednesday 23 September 2009, Ruediger Pluem wrote:
> --- modules/http/chunk_filter.c (Revision 818232)
> +++ modules/http/chunk_filter.c (Arbeitskopie)
> @@ -49,11 +49,11 @@
>  #define ASCII_CRLF  "\015\012"
>  #define ASCII_ZERO  "\060"
>      conn_rec *c = f->r->connection;
> -    apr_bucket_brigade *more;
> +    apr_bucket_brigade *more, *tmp;
>      apr_bucket *e;
>      apr_status_t rv;
> 
> -    for (more = NULL; b; b = more, more = NULL) {
> +    for (more = tmp = NULL; b; tmp = b, b = more, more = NULL) {
>          apr_off_t bytes = 0;
>          apr_bucket *eos = NULL;
>          apr_bucket *flush = NULL;
> @@ -85,7 +85,8 @@
>              if (APR_BUCKET_IS_FLUSH(e)) {
>                  flush = e;
>                  if (e != APR_BRIGADE_LAST(b)) {
> -                    more = apr_brigade_split(b,
>  APR_BUCKET_NEXT(e)); +                    more =
>  apr_brigade_split_ex(b, APR_BUCKET_NEXT(e), tmp); +               
>      tmp = NULL;
>                  }
>                  break;
>              }
> @@ -105,7 +106,8 @@
>                       * block so we pass down what we have so far.
>                       */
>                      bytes += len;
> -                    more = apr_brigade_split(b,
>  APR_BUCKET_NEXT(e)); +                    more =
>  apr_brigade_split_ex(b, APR_BUCKET_NEXT(e), tmp); +               
>      tmp = NULL;
>                      break;
>                  }
>                  else {
> 
> What is the point here? tmp is always NULL when passed to
>  apr_brigade_split_ex so apr_brigade_split_ex == apr_brigade_split

You missed the tmp = b at the beginning of the loop. The tmp = NULL 
lines were actually not needed. I have changed this a bit to hopefully 
make it clearer and commited the patch together with the other changes 
you suggested.

Cheers,
Stefan

Mime
View raw message