apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cliff Woolley <cliffwool...@yahoo.com>
Subject Re: cvs commit: apr-util/buckets apr_brigade.c
Date Wed, 28 Feb 2001 15:38:23 GMT
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


Mime
View raw message