Mathias Herberts wrote:
Hi,
still in the process of building an Input Connection Filter I noticed something wrong with all Connection Filter examples I could find (including HTTPHeadersFixup), in case the connection is instructed to be kept open with 'Connection: Keep-Alive', several requests will be run through the same instance of the filter, therefore it is not possible to safely ignore the possible body of a POST (or DAV) request. One must keep track of Content-Length and only ignore body if 'Connection: close' was issued (as per RFC 2616).
Anybody else aware of that?
Not me. I'm still learning the topic ;) Thanks for the heads up, Mathias. I have never tried with 'Connection: Keep-Alive', though I think there must be a better way to tell separate requests from each other. I'll investigate this and get followup on this.
The net thrown in the httpd-dev sea came back empty. The fish is hiding behind the rocks, scratching their private itches.
It seems that Apache provides no way to tell one request over another when Keep-Alive is in effect. I need to look at the ap_discard_body function, since somehow it knows when there is no more body to read.
Meanwhile I have the following filter tandem idea that may do the trick. We could add a connection response filter, whose only purpose will be to set a note in the connection object when it sees the response headers (I don't think EOS is sent in the response stream) flagging the incoming filter mate that the next time it's invoked it'll be a new request. That will only work if after sending the headers, it's known that the request body is fully consumed. I think that's the case, but I'm not 100% sure.
__________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
-- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html