httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Jagielski <>
Subject Re: nph and lingering_close
Date Fri, 23 Aug 1996 13:39:02 GMT
Alexei Kosut wrote:
> Okay...
> I've spent the last few hours trying to figure out why nph scripts don't
> work with the lingering close code. It boils down to something like this:
> When mod_cgi starts an nph script, it duplicates the client connection fd,
> and passes it to the CGI script as stdout. Because there are two handles
> to this fd, when bclose() closes its, it doesn't actually close the
> socket because the CGI script still has one open. The connection stays
> open until the CGI script exits. However, lingering_close() uses
> shutdown(), which closes the socket right away, even though the CGI script
> still has a handle open to it.
> So... the fix? Well, a simple one is to simply make mod_cgi wait until the
> CGI script finishes before passing control back to Apache. This way you
> sidestep the problem entirely. Patch follows:

Nice and elegant. Works like a charm too!

Jim Jagielski  << >>   |   "There is a time for laughing,
  **  jaguNET Access Services  **      |    and a time for not laughing,
      Email:          |    and this is not one of them"
++         +++      Voice/Fax: 410-931-3157       ++

View raw message