Dan Wilga wrote:
At 12:02 PM -0700 8/2/04, Stas Bekman wrote:

Upon sending the response. The original error message happens in my code when I try to "print" the HTTP header.


Yeah, that's what I thought. I suppose we could handle that internally then. But I want to have a failing test first. It should work with LWP, just as you see in LWP. Not sure how to arrange that with LWP. Ideas? We need to start the request and then kill it. I suppose we could do an alarm handler, but with 5.8.0 safe signals things, I'm not sure it will actually work. Can you give it a try?


I'm using LWP::UserAgent::timeout (which essentially uses alarm), and am not having any luck reproducing the problem yet. The timeout does happen, but apparently LWP drops the connection in a different way from IE, because the error doesn't occur. I'm even using SSL to test this.

I also tried setting the user agent string of the request to match what IE sends, and this made no difference. I'm beginning to wonder if maybe I need to sniff the packets.

What about using a code abort alarm?

eval {
    local $SIG{ALRM} = sub { warn "LWP killed\n" };
    alarm 5;
    LWP::UserAgent->new->....
    alarm 0;
};

now arrange that the response handler will send a few bytes (don't forget $r->rflush), then sleep for let's say 5 secs and then will try to print a few more bytes. Time things in a way so that LWP is aborted after the first bytes were received, but not after the second print has happened.

Are you by chance using a proxy server?


Nope. Good thought, though.

OK, in mp1 you could catch the aborted connection state as long as you didn't use mod_proxy.
http://perl.apache.org/docs/1.0/guide/debug.html#Handling_the__User_pressed_Stop_button__case
--
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com


--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Reply via email to