You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Ian Holsman <ia...@apache.org> on 2002/03/20 04:47:37 UTC

brigade/filter Question/problem with ap_save_brigade

hi.
i think i've found a >potential< bug in ap_save_brigade

if i call ap_save_brigade on top of proxied content it segfaults
when it hits the sentinel bucket and tries to set it aside.

by using the following code fragement instead of calling the function
It seems to work quite nicely
      apr_bucket *e;
         APR_BRIGADE_FOREACH(e,bb) {
             if (e != APR_BRIGADE_SENTINEL(bb)) {
                 apr_bucket_setaside(e, f->r->pool);
             }
         }
         APR_BRIGADE_CONCAT(ctx->bb, bb);

the only real difference is the check for the sentinel.
so.. the Question.. do we need to do such a check or is there
some other bug in the filters ?

TIA
Ian


Re: brigade/filter Question/problem with ap_save_brigade

Posted by Cliff Woolley <jw...@virginia.edu>.
On Tue, 19 Mar 2002, Ian Holsman wrote:

> by using the following code fragement instead of calling the function
> It seems to work quite nicely
>       apr_bucket *e;
>          APR_BRIGADE_FOREACH(e,bb) {
>              if (e != APR_BRIGADE_SENTINEL(bb)) {
>                  apr_bucket_setaside(e, f->r->pool);
>              }
>          }
>          APR_BRIGADE_CONCAT(ctx->bb, bb);
> the only real difference is the check for the sentinel.
> so.. the Question.. do we need to do such a check or is there
> some other bug in the filters ?

You shouldn't need that.  Something VERY weird is going on if that fixes
it.  Because APR_BRIGADE_FOREACH(e,bb) is defined to be this:

for (e = APR_BRIGADE_FIRST(bb);
     e != APR_BRIGADE_SENTINEL(bb);
     e = APR_BUCKET_NEXT(e))

--Cliff

--------------------------------------------------------------
   Cliff Woolley
   cliffwoolley@yahoo.com
   Charlottesville, VA