httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Plüm, Rüdiger, VF-Group" <ruediger.pl...@vodafone.com>
Subject RE: mod_reqtimeout and mod_proxy: how to distinguish incoming from backend connections
Date Wed, 10 Mar 2010 09:42:12 GMT
 

> -----Original Message-----
> From: Stefan Fritsch 
> Sent: Dienstag, 9. März 2010 22:21
> To: dev@httpd.apache.org
> Subject: mod_reqtimeout and mod_proxy: how to distinguish 
> incoming from backend connections
> 
> Hi,
> 
> mod_proxy calls ap_run_pre_connection() on the backend connection, 
> which causes mod_reqtimeout to be inserted as filter. This is of 
> course wrong, because mod_reqtimeout will mess up mod_proxy's socket 
> timeouts.
> 
> After digging in the code I have found two potential solutions:
> 
> - The scoreboard handle conn->sbh is always NULL in mod_proxy's 
> backend connection. Mod_reqtimeout could use this to determine if it 
> should do something.
> 
> - mod_reqtimeout could hook into ap_run_process_connection with 
> APR_HOOK_LAST or APR_HOOK_REALLY_LAST-1, i.e. right before 
> ap_process_http_connection(). The hook function would then set a flag 
> to activate mod_reqtimeout and then return DECLINED. This should lead 
> to mod_reqtimeout only dealing with connections handled by 
> ap_process_http_connection.
> 
> 
> Both approaches are rather hack-ish but I think the second one is a 
> lot better than the first. It would also prevent mod_reqtimeout from 
> influencing protocol handlers like mod_echo and mod_ftp.
> 
> Does anyone have other ideas or comments?

Sounds reasonable.

Regards

Rüdiger


Mime
View raw message