You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by russell_kliese <ru...@yahoo.com> on 2005/08/09 03:46:48 UTC

Re: Kill CGI script after client breaks connection

> POSTING 1:
> To prevent my webserver from getting bogged down by
> long-running CGI scripts, which are no longer
> connected to the client's browser, I am trying to kill
> the CGI as soon as the connection with the browser
> breaks.
> In the older version of Apache (1.3 for example) a CGI
> script could do this by adding a signal handler for
> SIGPIPE.
> Is there an equivalent mechanism of terminating a CGI
> script after a client connection breaks in Apache2 ?

I experienced similar problems to what I expect you faced.  My sigpipe
handlers were no longer being called after upgrading to Apache 2.

The particular problem I experienced appears to be caused by some
libraries I am using that are resetting various signal handlers after
I had set them up.

The solution was to set the signal handlers just before they are
needed.

--
Russell Kliese
Eminence Technology