Skip Menu |

This queue is for tickets about the libwww-perl CPAN distribution.

Report information
The Basics
Id: 82375
Status: resolved
Priority: 0/
Queue: libwww-perl

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

Bug Information
Severity: Important
Broken in: 6.04
Fixed in: (no value)

Subject: keep_alive + https == hangs until timeout
    use LWP::UserAgent;
    my($keep_alive, $url) = @ARGV;
    print LWP::UserAgent->new( keep_alive => $keep_alive, timeout => 10 )->get($url)->content
    0 works fine
    4 works fine
    0 works fine
    4 times out but returns content

As demonstrated by the program above, and the various combinations of keep_alive and http vs https urls, when keep_alive is set LWP will hang retrieving an https URL until the timeout.  Then it will successfully return the content.

Its stuck on this line:

297:            my $nfound = select($fbits, undef, undef, $timeout);

Here's the stack trace.

$ = Net::HTTP::Methods::can_read(ref(LWP::Protocol::https::Socket)) called from file '/Users/schwern/perl5/perlbrew/perls/perl-5.16.2-threads/lib/site_perl/5.16.2/Net/HTTP/' line 257
$ = Net::HTTP::Methods::my_readline(ref(LWP::Protocol::https::Socket), 'Entity body') called from file '/Users/schwern/perl5/perlbrew/perls/perl-5.16.2-threads/lib/site_perl/5.16.2/Net/HTTP/' line 507
$ = Net::HTTP::Methods::read_entity_body(ref(LWP::Protocol::https::Socket), '', 4096) called from file '/Users/schwern/perl5/perlbrew/perls/perl-5.16.2-threads/lib/site_perl/5.16.2/LWP/Protocol/' line 409
$ = LWP::Protocol::http::__ANON__[/Users/schwern/perl5/perlbrew/perls/perl-5.16.2-threads/lib/site_perl/5.16.2/LWP/Protocol/] called from file '/Users/schwern/perl5/perlbrew/perls/perl-5.16.2-threads/lib/site_perl/5.16.2/LWP/' line 158
. = eval {...} called from file '/Users/schwern/perl5/perlbrew/perls/perl-5.16.2-threads/lib/site_perl/5.16.2/LWP/' line 99
$ = LWP::Protocol::collect(ref(LWP::Protocol::https), undef, ref(HTTP::Response), ref(CODE)) called from file '/Users/schwern/perl5/perlbrew/perls/perl-5.16.2-threads/lib/site_perl/5.16.2/LWP/Protocol/' line 420
$ = LWP::Protocol::http::request(ref(LWP::Protocol::https), ref(HTTP::Request), undef, undef, undef, 60) called from file '/Users/schwern/perl5/perlbrew/perls/perl-5.16.2-threads/lib/site_perl/5.16.2/LWP/' line 192
. = eval {...} called from file '/Users/schwern/perl5/perlbrew/perls/perl-5.16.2-threads/lib/site_perl/5.16.2/LWP/' line 191
$ = LWP::UserAgent::send_request(ref(LWP::UserAgent), ref(HTTP::Request), undef, undef) called from file '/Users/schwern/perl5/perlbrew/perls/perl-5.16.2-threads/lib/site_perl/5.16.2/LWP/' line 274
$ = LWP::UserAgent::simple_request(ref(LWP::UserAgent), ref(HTTP::Request), undef, undef) called from file '/Users/schwern/perl5/perlbrew/perls/perl-5.16.2-threads/lib/site_perl/5.16.2/LWP/' line 282
$ = LWP::UserAgent::request(ref(LWP::UserAgent), ref(HTTP::Request)) called from file '/Users/schwern/perl5/perlbrew/perls/perl-5.16.2-threads/lib/site_perl/5.16.2/LWP/' line 410
$ = LWP::UserAgent::get(ref(LWP::UserAgent), '') called from -e line 1

perl 5.16.2 on OS X 10.8.2
LWP 6.04
LWP::Protocol::https 6.03
IO::Socket::SSL 1.81
Net::HTTPS 6.04
There is some discussion of a similar problem on StackOverflow which may be relevant.

$Net::HTTPS::SSL_SOCKET_CLASS is IO::Socket::SSL.  Net::HTTPS->can("blocking") points at IO::Socket::blocking().

Probable duplicate of

DOY's fix works for me.
6.06 fixed this.

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

Please report any issues with to