httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug MacEachern <>
Subject Re: function prototypes
Date Wed, 01 Jan 1997 17:05:44 GMT (Rob Hartill) wrote:

> Alexei Kosut wrote:
> >So why can't mod_perl use send_http_header(), like mod_cgi? 
> err, it probably can and should.
> >I see no
> >compelling reason why mod_perl needs to call basic_http_header(), and
> >I would need an explanation of this from a mod_perl person as to why
> >this is neccessary. Otherwise, I matinain a firm veto on adding it to
> >http_protocol.h.

Most Apache modules written in Perl will call $r->send_http_header.

The only time mod_perl itself uses basic_http_header is with
PerlSendHeader On

Why?  Most existing Perl CGI scripts have this line of code:
print "Content-type: text/html\n\n";
mod_cgi reads the script's output and stuffs headers into the 
outgoing headers table, before calling send_http_header, fine.
When a mod_perl script says 'print "something or other"', the 
data is pushed straight into rwrite()

If 'PerlSendHeader On' triggered send_http_header, headers are 
terminated with bputs("\015\012",fd), breaking
print "Content-type: text/html\n\n";

So, using basic_http_header was the easy way out.
I suppose the right thing to do is for mod_perl to read outgoing
data as mod_cgi does, but this would not be trivial with the 
existing API.  We have no FILE * to give scan_script_header_err().
I'll have to think about this more, in any case, mod_perl will
"do the right thing" before it becomes 1.00

> good for you;  it's lucky someone's awake   %-)

I am not, last night was rough, yet I do not see stars, instead,
little camels flying around with multi-colored feathers 8-)


View raw message