Summary: | ap_rgetline_core can return without consuming a full line | ||
---|---|---|---|
Product: | Apache httpd-2 | Reporter: | Hank Ibell <hwibell> |
Component: | Core | Assignee: | Apache HTTPD Bugs Mailing List <bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | Keywords: | FixedInTrunk |
Priority: | P2 | ||
Version: | 2.5-HEAD | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Mac OS X 10.1 | ||
Attachments: |
Handle AP_GETLINE_NOSPC_EOL flag in ap_rgetline_core()
Handle AP_GETLINE_NOSPC_EOL flag in ap_rgetline_core() |
Description
Hank Ibell
2018-03-20 16:34:31 UTC
seems like one band-aid would be to allow the core input filter to pass a larger static max length to apr_brigade_split_line, e.g. 2x so callers who real limits are lost as they call ap_get_brigade() are much safer for the typical scenarios where the limit is only boosted by a few KB. (8 to 12/16 or KB) This would mean apr_brigade_split_line would not leave the full line unread for < 16k even ap_rgetline_core was only willing to take the default 8k or something like 12 k. But really ap_rgetline_core() should be ditching all of this excess when trying to read a line. Created attachment 35863 [details] Handle AP_GETLINE_NOSPC_EOL flag in ap_rgetline_core() How about this change in ap_rgetline_core() which optionally (up to the caller) allows to consume the end of line on APR_ENOSPC. mod_proxy may use it to address Bug 62196. Also note that in the APR_ENOSPC case, ap_rgetline_core() would now unconditionnaly fill in the buffer up to its limits, which is not that bad IMHO (before, we might have returned an half filled or empty buffer depending on the non-fitting bucket size). Created attachment 35885 [details] Handle AP_GETLINE_NOSPC_EOL flag in ap_rgetline_core() After some testing, this v2 is to address the (corner) where the line is to be truncated at LF (while CR fits in), see comment in the patch. With this patch and attachment 35864 [details] (bug 62196), mod_proxy_http behaves correctly for headers above ResponseFieldSize. Comment on attachment 35885 [details]
Handle AP_GETLINE_NOSPC_EOL flag in ap_rgetline_core()
this did the trick for my heisenbug on Windows while testing Hank's original proxy patch. Thanks!
|