Bug 64295 - cannot override default Virtualhost's mod_reqtimeout
Summary: cannot override default Virtualhost's mod_reqtimeout
Status: RESOLVED FIXED
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_reqtimeout (show other bugs)
Version: 2.4.43
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-31 20:18 UTC by Aaron Ogburn
Modified: 2020-04-16 09:42 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron Ogburn 2020-03-31 20:18:49 UTC
RequestReadTimeout is only applying from the default virtual host, for example:

<VirtualHost *:80>
    ServerName host1.com
    RequestReadTimeout header=5 body=5
</VirtualHost>
<VirtualHost *:80>
    ServerName host2.com
    RequestReadTimeout header=5 body=10
</VirtualHost>

A request to host2.com still times out at 5 seconds for the post body instead of 10.  Perhaps it makes sense that the default host timeout has to apply since it starts applying during header read before a host is determined, but I haven't seen a reference that sets a clear expectation.

From eyeballing the code it looks like mod_reqtimeout is explicitly using the timeout from the "base server" (global/default) vhost.  The request vhost should be available in that hook and the vhost selection has taken place at that point.  So I'm not sure why it behaves like that.

Is it by design for only the default host RequestReadTimeout apply?  If so, can its doc be improved to clarify this?  Or is there a possible enhancement for at least the body timeout to apply from non-default hosts?
Comment 1 jfclere 2020-04-15 08:52:48 UTC
fixed by 1876540 in trunk, note that only body=n will work the headers have to parsed to get the VirtualHost.
Comment 2 jfclere 2020-04-16 09:42:08 UTC
Proposed for back port in 2.4.44