Re: how to trap connection reset/abort in Apache::Filter?

[prev] [thread] [next] [Date index for 2005/05/02]

From: Stas Bekman
Subject: Re: how to trap connection reset/abort in Apache::Filter?
Date: 06:50 on 02 May 2005
Jeff Ambrosino wrote:
> Actually, it looks like using APR::Error [1] and wrapping $f->print in
> an eval would do the trick...?

That's correct, Jeff. eval and check for APR::Const::ECONNRESET as 
explained in [1]

> [1] http://perl.apache.org/docs/2.0/api/APR/Error.html

Please report whether this did the trick. We ought to document this one, 
since many will encounter this issue.

> On 5/1/05, Jeff Ambrosino <jbambrosino@xxxxx.xxx> wrote:
> 
>>[Sun May 01 05:12:21 2005] [error] [client X.X.X.X]
>>Apache::Filter::print: (104)Connection reset by peer at
>>/var/httpd/lib/perl/MyOutputFilter.pm line
>>453n\tMyOutputFilter::handler('Apache::Filter=SCALAR(0x87106a8)',
>>'APR::Brigade=SCALAR(0x86eac6c)') called at -e line 0\n\teval {...}
>>called at -e line 0\nApache::Filter: (103) Software caused connection
>>abort at -e line 0
> 
> ....
> 
>>I assume the errors are due to the end user clicking "stop" or
>>navigating away from the page before it has finished being sent...
>>but is there a [more elegant] way of trapping these events from within
>>my mod_perl filter
> 
> ?


        -- 
        __________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@xxxxxx.xxx http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

(message missing)

Re: how to trap connection reset/abort in Apache::Filter?
Stas Bekman 06:50 on 02 May 2005

Generated at 15:53 on 25 May 2005 by mariachi v0.52