httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sameer <sam...@c2.net>
Subject Re: cgi - sigpipe, etc.
Date Sun, 09 Feb 1997 18:29:12 GMT
> On Sat, 8 Feb 1997, sameer wrote:
> 
> > 	Most CGIs would ignore SIGPIPE though, right? So that wouldn't
> 
> I don't think so.  In theory they _should_ and people are always told that
> is the way to tell if the client is gone, etc., but unless they install
> signal handlers the defaul action in nearly every language is to exit.  
> 
> I wonder if I am missing something here.  The way the source reads to me
> is NOT the way I have always thought things happened.
> 
> Note that the server doesn't get a SIGPIPE as things are now.  I would
> expect it to get an EPIPE from the write though. 

	When I looked at the source it does appear that the server
gets a SIGPIPE. THe server get's a SIGPIPE and logs 'send script headers
filed lost connection to client.'.


> 
> > break backwards compat if old CGIs that were ignoring SIGPIPE ended up
> > getting a SIGPIPE.
> > 
> > 
> > > Not AFAIK.  This is ugly.  If you start a CGI that outputs data forever,
> > > then abort the client, the script will keep going until you hit a timeout.
 
> > > 
> > > send_fd_length is braindead because it doesn't check the return code from
> > > bwrite so it keeps writing even though no more output is ever going to
> > > happen because the connection is dead dead dead.  I just took a quick
> > > look, but my suggested solution would be to change send_fd_length to abort
> > > if it gets a "bad" error from bcwrite (not necessarily just any error,
> > > though) and mod_cgi should probably check the send_fd return code and send
> > > a SIGPIPE to the CGI if there was an error.
> > > 


-- 
Sameer Parekh					Voice:   510-986-8770
President					FAX:     510-986-8777
C2Net
http://www.c2.net/				sameer@c2.net

Mime
View raw message