Skip Menu |

This queue is for tickets about the POE-Component-Client-HTTP CPAN distribution.

Report information
The Basics
Id: 30446
Status: resolved
Priority: 0/
Queue: POE-Component-Client-HTTP

Owner: Nobody in particular
Requestors: dan [...]

Bug Information
Severity: Normal
Broken in: 0.82
Fixed in: (no value)

Subject: Low timeout values cause premature timeout events
Download (untitled) / with headers
text/plain 968b
When setting the timeout to a low value, such as around 1 second, POE::Component::Client::HTTP will intermittently return premature 408 responses. That is, it can return a 408 even though the amount of time given in the timeout has not passed. Timeouts are usually set by the create_timer sub in POE::Component::Client::HTTP::Request. Line 354 is: my $seconds = $timeout - (time() - $self->[REQ_START_TIME]); I noticed that both here and where REQ_START_TIME is set, we use the builtin time instead of Time::HiRes. I also noticed that there is code in the POE::Component::Client::HTTP module to import Time::HiRes's time, if available. I copied the HiRes import code from POE::Component::Client::HTTP into POE::Component::Client::HTTP::Request. This fixed the issue for me; timeouts worked correctly for low values. I've attached a patch with the proposed change. Thanks, Dan p.s. Dist: POE-Component-Client-HTTP-0.82 Perl: ubuntu 5.8.8 OS: Ubuntu 7.10
Subject: timeoutbug.patch
Download timeoutbug.patch
text/x-diff 489b
--- 2007-11-03 11:56:04.000000000 -0400 +++ 2007-11-03 11:56:55.000000000 -0400 @@ -9,6 +9,16 @@ use Carp; use HTTP::Status; +BEGIN { + local $SIG{'__DIE__'} = 'DEFAULT'; + # Allow more finely grained timeouts if Time::HiRes is available. + # This code is also in POE::Component::Client::HTTP + eval { + require Time::HiRes; + Time::HiRes->import("time"); + }; +} + # Unique request ID, independent of wheel and timer IDs. my $request_seq = 0;
Patch applied as change 318. Thanks, Dan!

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to