httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Hartill <>
Subject nph woes
Date Thu, 01 Jun 1995 10:48:34 GMT

Here's an annoying problem...

  If a nph (or nph like) script is busy doing work, and the client
breaks the connection, the script doesn't catch the SIGPIPE until
it tries to read or write on the socket.

  Apache (and NCSA 1.3/1.4 I suppose) just sit and wait for the
cgi script to exit, so they don't notice the connection is lost, the
result is that until,
      a) the nph tries to read/write on the socket,  or
      b) the timeout alarm comes in

both Apache and the cgi continue to process the request, despite not
having anywhere to send the results.

  I noticed this in a 1 child config, with a nph script which had
a long sleep in it. Apache just locked up until the sleep or
timeout had elapsed.

  Now that Apache buffers output from non-nph scripts, the problem
also occurs when Apache buffers cgi output. Until it decides to
send the output on to the client, it doesn't know that the client
has long since gone.

  Aborted connections on non-cgi work as expected.

  Does anyone out there know of a way to detect the loss of the
socket without having to poll it ?

Rob Hartill                  

View raw message