httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Behlendorf <br...@organic.com>
Subject Re: [PATCH] to enhance bugdb.cgi
Date Fri, 25 Apr 1997 05:52:15 GMT
On Thu, 24 Apr 1997, Rodent of Unusual Size wrote:
> From the fingers of Dean Gaudet flowed the following:
> >
> >On Thu, 24 Apr 1997, Rodent of Unusual Size wrote:
> >>     The "unbuffers STDOUT" is referring to turning off Perl's buffering
> >>     of the pipe back to Apache.  Standard CGI practise.
> >
> >Not really standard.  Just suggested for some user problems so as to avoid
> >explaining all the gory details.  Unless you're spawning external programs
> >whose output is also going back to apache you probably want to keep your
> >stdout buffered.  The problem is that not everything will flush before
> >running a fork/exec and so the child output may appear in the "wrong order".
> 
>     That's one problem.  Another is that if your script sends headers
>     and then pauses for a while before generating anything else, the
>     headers may sit in Perl's buffer and not make it to the server,
>     resulting in a timeout ("malformed headers").

Hmm, I'd like evidence this has happened.  bugdb.cgi isn't like lightning but
it hasn't been so slow as to timeout in my experience.... when has it done so
for you?  I don't see evidence of failure in recent Apache logs.

Turning it on can mean a tremendous impact on the number of packets sent to the
user, since every print() is now also a flush().  If you're concerned
specifically about headers why not just put a flush() after the headers end?

As for line endings - in previous CGI scripts I've done

s/\r\n/\n/;
s/\r/\n/;

Which should handle both cases Paul mentioned fine.

bugdb.cgi is certainly no paragon of programming, it's on at least its third
generation as a repurposed hackneyed piece of code.

	Brian


--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
brian@organic.com  www.apache.org  hyperreal.com  http://www.organic.com/JOBS



Mime
View raw message