Subject: | Timeout param doesn't work |
Hi,
i've started using the module a few days ago and noticed that it doesn't
use the timeout param, and actually there isn't a way to change the
default 180 value.
init the module:
my $asyncAgent = HTTP::Async->new;
$asyncAgent->timeout ( 10 );
add request
my $request = HTTP::Request->new( "GET", "http://92.112.219.158" );
my $reqID = $asyncAgent->add( $request );
here is waits 180 sec and doesn't timeout after 10 as specified.
i've debugged the problem and stepped into the code, while comparing it
to lwp-useragent.
i've found that when a new INET module is being created, the
arg{Timeout} param isn't transferred to the class, thus not updating the
new value to 10.
eventually when Socket is initialied:
sub new {
my($class,%arg) = @_;
my $sock = $class->SUPER::new();
$sock->autoflush(1);
##### here $are{Timeout} is EMPTY..... ##############
${*$sock}{'io_socket_timeout'} = delete $arg{Timeout};
######################################################
return scalar(%arg) ? $sock->configure(\%arg)
: $sock;
}
i'm not entirely sure how the flow works and how can i add the timeout
value...
hope you will see it better than i do.
Distribution ver: HTTP::Async 0.09
Perl version: v5.8.8 built for x86_64-linux-thread-multi
OS: 2.6.20-1.2320.fc5 x86_64 GNU/Linux (Fedora Core 5)