develooper Front page | perl.libwww | Postings from June 2014

Re: LWP hangs forever with get

Thread Previous | Thread Next
Steffen Ullrich
June 1, 2014 22:05
Re: LWP hangs forever with get
Message ID:

>              {
>                  die "read timeout" unless $self->can_read;
>                  my $n = $self->sysread($_, 1024, length);
>                  unless (defined $n) {
>                      redo READ if $!{EINTR} || $!{EAGAIN};

The server makes a connection reset if you try to access On unix this will set $! to ECONNRESET, 
and for unknown reason this will not set $! on Windows with Strawberry 
perl5.18.2 , but only returns "SSL read error" from the SSL layer.

Thus $! will stay at EINTR from the previous error and it will loop forever.

IO::Socket::SSL 1.992 (just released) works around this problem by resetting $! 
before doing I/O. This way $! will no longer stay at $!, but will be undef and 
thus the loop will exit, albeit with no specific error. The real fix would be of 
course to set $! to ECONNRESET in the underlying IO::Socket layer if the TCP 
connection was reset.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About