httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject Re: how to tell one request from another inside a connection filter over keep-alive connection
Date Tue, 02 Mar 2004 04:18:53 GMT
Stas Bekman wrote:
> If I'm inside an input connection filter and want to be able to tell one 
> HTTP request from another what should I do? Counting Content-length is 
> ineffective, and a won't work if C-L header is wrong.
> I can tell the end of HTTP headers section from the request body, by 
> matching /^[\r\n]$/ while reading HTTP headers. But I see no token that 
> tells me that the body is done. Any filter examples I can look at?
> Also, why there is no EOS token in connection level filters? if you had 
> some data buffered how do you know when to flush it?
> With Keep-Alive requests I get some IMMORTAL bucket after the last 
> request. Not sure what it is. At the moment just snooping on the traffic.

Answering my own question, the solution is to use conn->keepalives counter 
which is incremented at the end of each request. By storing the previous count 
and comparing with the current count one can tell when a new request is coming 
in over the keepalive connection. This technique is now documented in the 
mod_perl land:

Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker     mod_perl Guide --->

View raw message