summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/site/lib/LWP/Protocol/http.pm
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-04-18 23:10:57 +0000
committerKarl Berry <karl@freefriends.org>2017-04-18 23:10:57 +0000
commit40b4b6e177c62a14c166dbba6adf3abc415af4b2 (patch)
tree2996bf29509c806bd8064fb6cf38092c1b375ff8 /Master/tlpkg/tlperl/site/lib/LWP/Protocol/http.pm
parent8e743c86b6872f30b7a35c72aa944455157d4b3f (diff)
tlperl 5.24.1 from siep
git-svn-id: svn://tug.org/texlive/trunk@43914 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/tlperl/site/lib/LWP/Protocol/http.pm')
-rw-r--r--Master/tlpkg/tlperl/site/lib/LWP/Protocol/http.pm22
1 files changed, 12 insertions, 10 deletions
diff --git a/Master/tlpkg/tlperl/site/lib/LWP/Protocol/http.pm b/Master/tlpkg/tlperl/site/lib/LWP/Protocol/http.pm
index 23c361f7055..2266b1e9ea6 100644
--- a/Master/tlpkg/tlperl/site/lib/LWP/Protocol/http.pm
+++ b/Master/tlpkg/tlperl/site/lib/LWP/Protocol/http.pm
@@ -1,16 +1,14 @@
package LWP::Protocol::http;
-
+$LWP::Protocol::http::VERSION = '6.25';
use strict;
require HTTP::Response;
require HTTP::Status;
require Net::HTTP;
-use vars qw(@ISA @EXTRA_SOCK_OPTS);
-
-require LWP::Protocol;
-@ISA = qw(LWP::Protocol);
+use base qw(LWP::Protocol);
+our @EXTRA_SOCK_OPTS;
my $CRLF = "\015\012";
sub _new_socket
@@ -39,6 +37,7 @@ sub _new_socket
my $status = "Can't connect to $host:$port";
if ($@ =~ /\bconnect: (.*)/ ||
$@ =~ /\b(Bad hostname)\b/ ||
+ $@ =~ /\b(nodename nor servname provided, or not known)\b/ ||
$@ =~ /\b(certificate verify failed)\b/ ||
$@ =~ /\b(Crypt-SSLeay can't verify hostnames)\b/
) {
@@ -131,7 +130,7 @@ sub request
# check method
my $method = $request->method;
unless ($method =~ /^[A-Za-z0-9_!\#\$%&\'*+\-.^\`|~]+$/) { # HTTP token
- return HTTP::Response->new( &HTTP::Status::RC_BAD_REQUEST,
+ return HTTP::Response->new( HTTP::Status::RC_BAD_REQUEST,
'Library does not allow method ' .
"$method for 'http:' URLs");
}
@@ -168,7 +167,7 @@ sub request
my $cache_key;
if ( $conn_cache ) {
$cache_key = "$host:$port";
- # For https we reuse the socket immediatly only if it has an established
+ # For https we reuse the socket immediately only if it has an established
# tunnel to the target. Otherwise a CONNECT request followed by an SSL
# upgrade need to be done first. The request itself might reuse an
# existing non-ssl connection to the proxy
@@ -181,6 +180,9 @@ sub request
$socket->close;
$socket = undef;
} # else use $socket
+ else {
+ $socket->timeout($timeout);
+ }
}
}
@@ -496,7 +498,7 @@ sub request
#-----------------------------------------------------------
package LWP::Protocol::http::SocketMethods;
-
+$LWP::Protocol::http::SocketMethods::VERSION = '6.25';
sub ping {
my $self = shift;
!$self->can_read(0);
@@ -509,7 +511,7 @@ sub increment_response_count {
#-----------------------------------------------------------
package LWP::Protocol::http::Socket;
-use vars qw(@ISA);
-@ISA = qw(LWP::Protocol::http::SocketMethods Net::HTTP);
+$LWP::Protocol::http::Socket::VERSION = '6.25';
+use base qw(LWP::Protocol::http::SocketMethods Net::HTTP);
1;