You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by M K <ma...@yahoo.com> on 2004/07/30 04:53:13 UTC

[users@httpd] Kill CGI script after client breaks connection

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 ?
Thanks a lot!
-M.K.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.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] Kill CGI script after client breaks connection

Posted by "Gustavo A. Baratto" <gb...@superb.net>.
apache 2 has mod_cgid enabled by default on threadred platforms... a hack on
that would be a good way to achieve what we want.
Maybe this is a subject for the development mailing list.

I'm suprised more ppl don't need such feature.

thanks ;)


----- Original Message ----- 
From: "M K" <ma...@yahoo.com>
To: <us...@httpd.apache.org>
Sent: Friday, July 30, 2004 2:14 PM
Subject: Re: [users@httpd] Kill CGI script after client breaks connection


> >   The CHANGES file in the httpd source tree says:
> >   *) timeout() signal handler now checks for SIGPIPE
> > and reports lost connections in a more user friendly
> > way. [Rob Hartill]
> Sorry, I forgot to mention that this change was made
> in apache 1.0.3, as mentioned in the CHANGES file. Was
> this code removed out later?
>   Thanks a lot!
>
>
>
>
> >   But I could not find anything related in the
> > source
> > code.
> >
> >   Thanks for the response though.. I hope someone
> > can
> > advise on this.
> >
> >
> > --- "Gustavo A. Baratto" <gb...@superb.net>
> > wrote:
> >
> > > Hi... I always wanted to do this on apache 1.3X
> > but
> > > never had time to run
> > > after a solution.
> > >
> > > could you give me more information on this?
> > > thanks :)
> > >
> > > ----- Original Message ----- 
> > > From: "M K" <ma...@yahoo.com>
> > > To: <us...@httpd.apache.org>
> > > Sent: Thursday, July 29, 2004 7:53 PM
> > > Subject: [users@httpd] Kill CGI script after
> > client
> > > breaks connection
> > >
> > >
> > > > 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
> > > ?
> > > > Thanks a lot!
> > > > -M.K.
> > > >
> > > >
> > __________________________________________________
> > > > Do You Yahoo!?
> > > > Tired of spam?  Yahoo! Mail has the best spam
> > > protection around
> > > > http://mail.yahoo.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
> > > >
> > >
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > 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
> > >
> > >
> >
> >
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Mail - Helps protect you from nasty viruses.
> > http://promotions.yahoo.com/new_mail
> >
> >
> ---------------------------------------------------------------------
> > 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
> >
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.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
>


---------------------------------------------------------------------
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] Kill CGI script after client breaks connection

Posted by M K <ma...@yahoo.com>.
>   The CHANGES file in the httpd source tree says:
>   *) timeout() signal handler now checks for SIGPIPE
> and reports lost connections in a more user friendly
> way. [Rob Hartill]
Sorry, I forgot to mention that this change was made
in apache 1.0.3, as mentioned in the CHANGES file. Was
this code removed out later?
  Thanks a lot!
  



>   But I could not find anything related in the
> source
> code.
>   
>   Thanks for the response though.. I hope someone
> can
> advise on this.
> 
> 
> --- "Gustavo A. Baratto" <gb...@superb.net>
> wrote:
> 
> > Hi... I always wanted to do this on apache 1.3X
> but
> > never had time to run
> > after a solution.
> > 
> > could you give me more information on this?
> > thanks :)
> > 
> > ----- Original Message ----- 
> > From: "M K" <ma...@yahoo.com>
> > To: <us...@httpd.apache.org>
> > Sent: Thursday, July 29, 2004 7:53 PM
> > Subject: [users@httpd] Kill CGI script after
> client
> > breaks connection
> > 
> > 
> > > 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
> > ?
> > > Thanks a lot!
> > > -M.K.
> > >
> > >
> __________________________________________________
> > > Do You Yahoo!?
> > > Tired of spam?  Yahoo! Mail has the best spam
> > protection around
> > > http://mail.yahoo.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
> > >
> > 
> > 
> >
>
---------------------------------------------------------------------
> > 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
> > 
> > 
> 
> 
> 
> 		
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail - Helps protect you from nasty viruses.
> http://promotions.yahoo.com/new_mail
> 
>
---------------------------------------------------------------------
> 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
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.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] Kill CGI script after client breaks connection

Posted by M K <ma...@yahoo.com>.
Hi Gustavo,
  I hope someone can point me in a general direction,
of where to look....
  I am using mod_cgi.
  What we need here is a way to relay/signal back the 
client-disconnect to the CGI either via a signal (like
in the fastCGI module) or add some function that the
CGI can call to monitor the status of the client
connection.
  The CHANGES file in the httpd source tree says:
  *) timeout() signal handler now checks for SIGPIPE
and reports lost connections in a more user friendly
way. [Rob Hartill]
  But I could not find anything related in the source
code.
  
  Thanks for the response though.. I hope someone can
advise on this.


--- "Gustavo A. Baratto" <gb...@superb.net> wrote:

> Hi... I always wanted to do this on apache 1.3X but
> never had time to run
> after a solution.
> 
> could you give me more information on this?
> thanks :)
> 
> ----- Original Message ----- 
> From: "M K" <ma...@yahoo.com>
> To: <us...@httpd.apache.org>
> Sent: Thursday, July 29, 2004 7:53 PM
> Subject: [users@httpd] Kill CGI script after client
> breaks connection
> 
> 
> > 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
> ?
> > Thanks a lot!
> > -M.K.
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around
> > http://mail.yahoo.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
> >
> 
> 
>
---------------------------------------------------------------------
> 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
> 
> 



		
__________________________________
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.
http://promotions.yahoo.com/new_mail

---------------------------------------------------------------------
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] Kill CGI script after client breaks connection

Posted by "Gustavo A. Baratto" <gb...@superb.net>.
Hi... I always wanted to do this on apache 1.3X but never had time to run
after a solution.

could you give me more information on this?
thanks :)

----- Original Message ----- 
From: "M K" <ma...@yahoo.com>
To: <us...@httpd.apache.org>
Sent: Thursday, July 29, 2004 7:53 PM
Subject: [users@httpd] Kill CGI script after client breaks connection


> 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 ?
> Thanks a lot!
> -M.K.
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.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
>


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