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

Re: LWP hangs forever with get

Thread Previous | Thread Next
From:
Steffen Ullrich
Date:
June 1, 2014 22:05
Subject:
Re: LWP hangs forever with get
Message ID:
lmg7h0$mak$1@ger.gmane.org

>
> READ:
>              {
>                  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 
https://www.butler.edu/boa/default.aspx. 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.

Steffen



Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About