apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cliff Woolley <cliffwool...@yahoo.com>
Subject Re: apr_bucket_simple_split
Date Sat, 25 Aug 2001 22:46:43 GMT
On Sat, 25 Aug 2001, William A. Rowe, Jr. wrote:

> My patch didn't change behavior.  The prior test is point < 0, that
> was, -1.

It was to check for _any value_ less than zero, not just -1.  That's
because a value less than zero will cause the arithmetic to get fscked up
in the split function and then buckets will have lengths one too long and
all kinds of funky stuff like that... it would be very hard to debug.

> Now that they can be a full apr_size_t, we still need to check that
> it's not -1, unless you want to alter this.  I was simply changing
> from a signed to an unsigned type.

Ahh, but there in lies the source of my confusion.  I wasn't thinking
about the fact that apr_size_t is unsigned.  So I guess we just give up on
that test entirely and leave it up to the caller.  That's fine.  It's more
important to check that point <= a->length anyhow.

> You don't register a bucket function by bucket, you register it by
> bucket_type. Perhaps some types of buckets can split some of the time,
> but not all the time. Correct?  (E.g. we can split a file bucket of
> known length, but not one of an indeterminate length.)

<scratching head>  Huh?  I can't grok what you just said for some reason.
Anyhow, I don't think it matters... I think I've figured out the answer to
my original question.  We should be able to just test point against
a->length and ignore the possibility of it being "negative".

Right?  Right.

--Cliff

--------------------------------------------------------------
   Cliff Woolley
   cliffwoolley@yahoo.com
   Charlottesville, VA




Mime
View raw message