On 12/26/2016 11:23 AM, Eric Covener wrote:
> No good hint here, but I have found the gdb macros in .gdbinit to be
> really helpful to show these details.
>
> (dump_brigade, dump_bucket IIRC)
Hi, Eric;
Right - that more or less confirms the confusion. There's only one
bucket in the brigade (which seems odd) and it believes it's 11 bytes in
length.
(gdb) dump_brigade bb
dump of brigade 0x7fffd8007630
| type (address) | length | data addr |
contents | rc
--------------------------------------------------------------------------------
0 | HEAP (0x7fffd8000928) | 11 | 0x7fffd80009c8 | [PROXY TCP4
] | 2
end of brigade
(gdb) dump_bucket b
bucket=HEAP (0x7fffd8000928) length=11 data=0x7fffd80009c8
contents=[PROXY TCP4 ] rc=2
(gdb) p nbytes
$13 = 11
(gdb) p tmp_buf
$14 = 0x7fffd801a0d8 "PROXY TCP4 192.168.0.103 172.17.0.2 44585
82\r\n\026\003"
(gdb) call strlen(tmp_buf)
$15 = 48
This output is immediately after apr_bucket_read(b, &tmp_buf, &nbytes,
APR_BLOCK_READ);... indeed, nbytes and the length of the bucket agree
but there are 48 characters available (in this example) in the buffer.
--
Daniel Ruggeri