httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Walter <si...@gikaku.com>
Subject Re: [users@httpd] apr_bucket_split data remains
Date Mon, 01 Jan 2018 14:21:53 GMT
On 01/01/2018 10:44 PM, Eric Covener wrote:
> 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.
> 

I see such code as the example you gave in various places. However, this
bit of code (attached) shows me that I cannot simply printf the data.
Again, I am probably doing something wrong.

Mime
View raw message