httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cliff Woolley" <>
Subject buckets: null terminated strings?
Date Sat, 22 Jul 2000 02:32:28 GMT

I was trying to accomplish the seemingly simple task of cleaning up a
few problems with *_insert and *_split, and keep bashing my head against
the wall for one simple reason:

Because we allow the data in a bucket to be treated as a regular string
by simply returning a pointer to the beginning of it, we assume that
that data is null-terminated somehow.  But when we split a bucket (take
an rmem or mmap bucket for example), we never shove in a null byte in
between half a and half b of the original string, so getting the string
from bucket a would return the original string (ie, a+b), not just a --
that is, not without copying b in order to do the split so that we would
have a place to stick in that extra null byte at the end of a.  YUCK!

So I guess we have to force bucket b to be created as a new rwmem bucket
(thereby copying that half of the data) in order to split it off from
bucket a?  That seems like the cleanest way to do it to me. 
Unfortunately.  What about mmap buckets?  Is it correct that splitting
an mmap bucket into two pieces should yield one mmap bucket and one
rwmem bucket?

Am I just flat out wrong, or is there some other really, really, obvious
solution that I'm not seeing, or is this pretty much just the way it is?


Cliff Woolley
Central Systems Software Administrator
Washington and Lee University

Work: (540) 463-8089
Pager: (540) 462-2303

View raw message