Re: Headers Sent Twice

"Jonathan Swartz" <[email protected]>
Newsgroups gmane.comp.web.mason.devel
Message-ID <[email protected]>
We should use http_header_sent($r). Otherwise, it seems reasonable...

But looking at this code,

    my $request = eval {
        $interp->make_request( comp => $comp_path,
                               args => [%$args],
                               ah => $self,
                               apache_req => $r,
                             );
    };
    if (my $err = $@) {
        ...
        my $retval = isa_mason_exception($err, 'Abort')   ?
$err->aborted_value  :
                     isa_mason_exception($err, 'Decline') ?
$err->declined_value :

Why are we checking for an abort or decline exception? Is it possible to
call abort or decline during make_request? David, remind me why this is
necessary... :)

Jon

> On Apr 30, 2004, at 9:47 PM, Dave Rolsky wrote:
>
> > But why should Mason be called in this case at all?  If you're going to
> > send output from the pre-Mason callbacks, you might as well skip
> > calling
> > the Mason component altogether, right?
>
> No Mason component is called. However, the AH is created, and
> handle_request and therefore prepare_request() are called. The
> callbacks are executed by the call to $interp->make_request in
> prepare_request(). And it is there that your eval catches exceptions
> and sends headers. So since my callbacks are executing then (and
> really, because Interp can be subclassed, other applications may send
> headers at that point), it makes sense to me to send the headers only
> if they haven't already been sent.
>
> Make sense?
>
> Thanks,
>
> David
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: Oracle 10g
> Get certified on the hottest thing ever to hit the market... Oracle 10g.
> Take an Oracle 10g class now, and we'll give you the exam FREE.
> http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
> _______________________________________________
> Mason-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mason-devel
>



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE. 
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.