You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Roy T. Fielding" <fi...@kiwi.ics.uci.edu> on 1997/07/14 12:14:06 UTC

Make cgi unbuffered is bogus

>  +   *) CGI: Add a select() loop so that CGI scripts don't have to be
>  +      nph in order to be "unbuffered". [Sameer Parekh]

This one is about to be de-committed. No, it isn't salvageable.
It creates a bunch of BUFF streams assuming that the CGI script will
use them like a module, but the scripts are only going to write
directly to the file descriptor.  It then turns buffering *off*
so that it can read from the BUFF just like a normal fd.
In the procees, it also adds an indefinite block on select, doesn't
check for error conditions on bwrite (potentially losing parts of
the header fields already in the buffer), doesn't check for error
conditions on the select, performs an extra copy of all data that is
output, fails to check for the soft_timeout conditions, introduces
seven potential infinite loops where bgets replaced fgets in mod_cgi.c,
and reintroduces the problem of per-subrequest cleanups on virtual SSI.
It also duplicates a hell of a lot of ancilliary code.  All this
instead of just doing a select on the original FILE* file descriptor!

Gag me with a spoon.  -1

.....Roy