Bug 49167 - HTTP_IN filter confusing error with timeout on chunk-length
Summary: HTTP_IN filter confusing error with timeout on chunk-length
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: Core (show other bugs)
Version: 2.5-HEAD
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
Keywords: FixedInTrunk
Depends on:
Reported: 2010-04-21 17:30 UTC by Eric Covener
Modified: 2010-04-26 22:00 UTC (History)
0 users

naive patch for illustration (1.50 KB, patch)
2010-04-21 17:31 UTC, Eric Covener
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Covener 2010-04-21 17:30:30 UTC
When there's a timeout reading the very first chunk length, Apache returns a 413 error response. This might be better as a 400 or 408.

When there's a timeout reading any other chunk length, Apache returns a concatenation of the 413 and 400 error response due to the HTTP_IN filter adding a 413 error response then returning APR_TIMEUP from the filter.

I haven't looked at what this means to the proxies usage of HTTP_IN, but since all the current ones are already a misleading 4xx maybe a change to 400 or 408 wouldn't do much harm.

I'm attaching a patch to illustrate where the issue manifests but it's just for illustration purposes. My requests are e.g.:

printf "POST / HTTP/1.1\r\nHost: foo\r\nTransfer-Encoding: chunked\r\n\r\n" | nc 0 80

printf "POST / HTTP/1.1\r\nHost: foo\r\nTransfer-Encoding: chunked\r\n\r\n4\r\nabcd\r\n" | nc 0 80

(2.2.x returns a pair of 413s instead of a 413 and a 400 for the later chunks)
Comment 1 Eric Covener 2010-04-21 17:31:08 UTC
Created attachment 25329 [details]
naive patch for illustration
Comment 2 Ruediger Pluem 2010-04-22 04:23:44 UTC
Patch looks good to me. Please commit.