httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Graham Leggett <>
Subject [PATCH] bugfix in http_filter()
Date Mon, 09 Apr 2001 15:58:38 GMT
Hi all,

I traced the problems I was having with apr_bucket_read() returning an
empty string instead of the next line of LF terminated ASCII to a
problem in the line-at-a-time behavior of HTTP_IN.

If some text was read in, and the terminating LF character was the last
character in the bucket, the filter would still split this bucket,
producing the original bucket followed by an empty bucket.

The first text bucket got sent back in response to the request, but the
rogue empty bucket was placed at the head of the queue to be fetched at
the next request. The next time apr_bucket_read() was called, this empty
bucket was returned, and the calling function saw an empty line instead
of the next line as expected.

In theory the bug really exists with the calling function -
apr_bucket_read() should be called multiple times until the LF is found.
However it is usually safe to assume that the first time
apr_bucket_read() is called the first piece of data should be returned,
not an empty bucket. This could confuse module authors down the line (it
sure confused the hell out of me...).

The fix is attached.

-----------------------------------------		"There's a moon
					over Bourbon Street
View raw message