httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Slemko <ma...@worldgate.com>
Subject Re: client connection questions
Date Wed, 02 Sep 1998 21:15:36 GMT
On Wed, 2 Sep 1998, Doug MacEachern wrote:

> A few questions:
> 
> If ap_rwrite/ap_bwrite returns -1, does that *always* mean the connection
> is broken?  

It means you can't write to it any more and shouldn't retry AFAIK.

> 
> r->connection->aborted is only set if a soft_timeout happens, why not with
> hard_timeout too?

Because if a hard timeout happens, your code will never be in a position
to see the r->connection->aborted.  

If rwrite is returning -1 and you are in a hard timeout and you are still
in your code, then timeout() was _not_ called because Apache did not
figure out that the connection was closed via SIGPIPE, so setting
r->connection->aborted there is nonsensical.

> 
> What is the "right" test to find out if the connection has been broken? 

If you are in a hard timeout, you "shouldn't" be left there if the
connection is broken, but since SIGPIPE is a bad idea then it could
happen.  So all you have to do is be sure to check your return values from
output functions.



Mime
View raw message