Re: LWP hangs forever with get

Steffen Ullrich <[email protected]> Sun, 01 Jun 2014 23:55:42 +0200
Newsgroups gmane.comp.lang.perl.modules.lwp
Message-ID <[email protected]>
>
> 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