httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ronald Park <r...@cnet.com>
Subject Behaviour for Connection: close
Date Fri, 01 Feb 2008 16:59:56 GMT
I'm writing a module which is intended to do it's work
'asynchronously'.  My module takes the body of a POST,
stores it into a note and immediately generates a response
code of 200.  Then, during the logging stage, it does
that actual work (in my case, writing stuff into a db).

I have 'KeepAlives off' and, as expected, Apache sends
back the 200 and 'Connection: close'... however, it does
not "immediately" close the socket.  It proceeds to do
logging and runs my code *then* closes the socket.

The behavior is fine for some clients, those that see the
'Connection: close' and close their connections themselves.
For them, my module is 'asynchronous'.  For others clients
though, ones which wait for the server to close, it's not;
their requests are practically synchronous (actually, a
little slower).

Is there a way to hook my module in absolutely after the
close is called?  Is there a way to get the socket close
to occur immediately after the response is sent?

Or, am I going to have to do something like spawning off
a thread, copying all the request data into that thread
(so it doesn't go poof when the request pool is destroyed)
and doing my work in that thread? :(

Thanks,
Ron


Mime
View raw message