httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Covener <cove...@gmail.com>
Subject Re: [users@httpd] apr_bucket_split data remains
Date Mon, 01 Jan 2018 13:44:19 GMT
On Mon, Jan 1, 2018 at 8:37 AM, Simon Walter <simon@gikaku.com> wrote:
> I am interested in how apr_bucket_split(e, point) works.
>
> It seems that after splitting e, it still contains everything after
> point. Only when flattened is this data "removed" from e.
>
> If that is correct, then is it also correct to assume that I would need
> to use apr_bucket_read with snprintf and make a copy of the data in
> order to display it accurately?
>
> Is there another way to show the contents of buckets after they've been
> split/manipulated?
>
> I need to flatten the brigade (or flush it to a socket? that's a
> different question), but for debugging purposes, to check my logic, I am
> trying to see the contents of individual buckets.
>

I don't think that's right. For example mod_substitute does this to
remove the pattern that matched from the input:

#define SEDRMPATBCKT(b, offset, tmp_b, patlen) do {  \
    apr_bucket_split(b, offset);                     \
    tmp_b = APR_BUCKET_NEXT(b);                      \
    apr_bucket_split(tmp_b, patlen);                 \
    b = APR_BUCKET_NEXT(tmp_b);                      \
    apr_bucket_delete(tmp_b);                        \
} while (0)


The dump_brigade macro in .gdbinit in the source tree will help here.
You can also use the code there to add your own trace.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message