You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Cliff Woolley <cl...@yahoo.com> on 2001/02/28 16:38:23 UTC
Re: cvs commit: apr-util/buckets apr_brigade.c
On 28 Feb 2001 rbb@apache.org wrote:
> buf = malloc(APR_BUCKET_BUFF_SIZE);
> b = apr_bucket_heap_create(buf, APR_BUCKET_BUFF_SIZE, 0, NULL);
> APR_BRIGADE_INSERT_TAIL(bb, b);
> + b->length = 0; /* We are writing into the brigade, and
> + * allocating more memory than we need. This
> + * ensures that the bucket thinks it is empty just
> + * after we create it. We'll fix the length
> + * once we put data in it below.
> + */
> }
Oooohh... good catch. Thanks, Ryan. This was one of the cases where the
original code was updating start and end but not length, but got away
with it because heap_read calculated length every time from end-start.
In the process of my translation to a "no-end world" :), I lost that line.
Martin and Jean-frederic, does this fix the corrupt data you were seeing?
--Cliff