You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Brown Chris-CCB034 <Ch...@motorola.com> on 2008/03/31 21:39:25 UTC

[users@httpd] Is it possible to keep a module running after closing a connection?

I'm looking at a situation where we'd want to close a connection (for
example the message size is too large) but we'd like to keep the thread
active so that we can perform some other steps before releasing the
thread.  Is this possible?  I've been looking through the apache header
files and nothing stands out to me as a method that would immediately
close the connection without releasing the thread.
 
Any help is greatly appreciated.
 
Thanks,
Chris

Re: [users@httpd] Is it possible to keep a module running after closing a connection?

Posted by Eric Covener <co...@gmail.com>.
On Mon, Mar 31, 2008 at 6:27 PM, Scott Gifford
<sg...@suspectclass.com> wrote:
> "Brown Chris-CCB034" <Ch...@motorola.com> writes:
>
>  > I'm looking at a situation where we'd want to close a connection (for example
>  > the message size is too large) but we'd like to keep the thread active so that
>  > we can perform some other steps before releasing the thread.  Is this possible?
>  >   I've been looking through the apache header files and nothing stands out to
>  > me as a method that would immediately close the connection without releasing
>  > the thread.
>
>  In the process model, you just fork() twice and continue your work in
>  the grandchild process.  Not sure with the threaded model, but
>  probably you could just create another thread to do your work, and set
>  it up to not require joining.
>
>  ----Scott.

You can do your followup processing in the logger hook, but you'll
have to stash away any data you need between hooks.

-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Is it possible to keep a module running after closing a connection?

Posted by Scott Gifford <sg...@suspectclass.com>.
"Brown Chris-CCB034" <Ch...@motorola.com> writes:

> I'm looking at a situation where we'd want to close a connection (for example
> the message size is too large) but we'd like to keep the thread active so that
> we can perform some other steps before releasing the thread.  Is this possible?
>   I've been looking through the apache header files and nothing stands out to
> me as a method that would immediately close the connection without releasing
> the thread.

In the process model, you just fork() twice and continue your work in
the grandchild process.  Not sure with the threaded model, but
probably you could just create another thread to do your work, and set
it up to not require joining.

----Scott.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org