Subject: | LWP::UserAgent fails on windows XP, likely also on Windows server 2008 |
used Strawberry Perl 5.20 32-bit - downloaded Dec 31 2014
LWP 6.08
I recently got a ticket for my module TestRail::API.
The reporter noted that there were some bizarre intermittent failures on windows server '08; the socket comms seemed flaky.
So, I decided to investigate. On windows XP (the closest to server '08 I can get my hands on), LWP failed completely to get any HTTP Resource, though IO::Socket::INET seemed fine:
#test.t--------------------------
use strict;
use warnings;
use Test::More tests => 2;
use LWP::UserAgent;
my $ua = LWP::UserAgent->new();
my $req = HTTP::Request->new();
$req->method('GET');
$req->url('http://google.com');
my $resp = $ua->request($req);
is($resp->code,200,"LWP can get google.com");
use IO::Socket;
my $sock = IO::Socket::INET->new(
PeerAddr => 'google.com',
LocalAddr => $ua->{local_address},
PeerPort => 80,
proto => 'tcp',
timeout => 60,
KeepAlive => !!$ua->{conn_cache},
SendTE => 1
);
ok($sock,"Can open socket on port 80 to google.com");
0;
Had test 1 fail, and test 2 was OK.
Windows 7 worked just fine.
LWP 6.05 works just fine, it's bundled with strawberry 5.18.2.2
This might not come as a surprise, though. CPANTesters seems to suggest windows is having some pretty big problems with 6.08.