Re: apr_bucket_split data remains

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jan 1, 2018 at 8:37 AM, Simon Walter <simon@xxxxxxxxxx> 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@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux