Ken Williams wrote:
> I know it was ages ago when you sent this patch, but what's the
> rationale for having $r->sent_header() return 1 when it hasn't sent the
> header?

I didn't want to break anything. I'm hoping that people using sent_header
are just checking for true, not for 1. (That's the way the mod_perl core
does it.)

> Shouldn't it be fixed to return 1 or 0 according to whether the
> header has actually been sent?

I'll let Doug decide. IMHO sent_header is the wrong method name. The current
function should be called need_headers. (When PerlSendHeader is on, you don't
need to send headers.) A new function should be added to let you know if the
headers have already been sent.

> If need be, perhaps it could distinguish like this:
> 
>    undef - headers have not been sent (PerlSendHeader on)
>        0 - headers have not been sent (PerlSendHeader off)
>        1 - headers have already been sent (PerlSendHeader off)
>        2 - headers have already been sent (PerlSendHeader on)

That might break code because you're changing the truth values. My code
didn't need to differentiate between the two unsent cases which is why
I'm only returning 3 different values.

- Ken

Reply via email to