httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Kew <n...@webthing.com>
Subject Re: Behaviour for Connection: close
Date Fri, 01 Feb 2008 18:03:24 GMT
On Fri, 01 Feb 2008 11:59:56 -0500
Ronald Park <ronp@cnet.com> wrote:

> 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.

Someone already mentioned 202:-)

> 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?

No.  The Connection outlives the Request.

> 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? :(

Well, you could create a thread at child_init, and use
an apr_queue to pass data to it, preferably in fixed-size
chunks (else you're going to have fun managing memory).
Or if the requests are large, maybe spool them to disc
and you can process them entirely separately (c.f. mod_smtpd
or other mailserver).

-- 
Nick Kew

Application Development with Apache - the Apache Modules Book
http://www.apachetutor.org/

Mime
View raw message