httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From (Rodent of Unusual Size)
Subject Re: [PATCH] to enhance bugdb.cgi
Date Thu, 24 Apr 1997 23:24:34 GMT
>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").

    So.. Unbuffering is *always* a good idea until the headers have been
    sent.  It's also a good idea if the output comes from async sources,
    too, as you mention.  Otherwise, re-enabling buffering after the
    headers are emitted is probably a win.

    #ken    :-)}

View raw message