diff options
Diffstat (limited to 'Master/tlpkg/tlperl/lib/Net/HTTP.pm')
-rw-r--r-- | Master/tlpkg/tlperl/lib/Net/HTTP.pm | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/Master/tlpkg/tlperl/lib/Net/HTTP.pm b/Master/tlpkg/tlperl/lib/Net/HTTP.pm index 919e591e16c..613bc9599e3 100644 --- a/Master/tlpkg/tlperl/lib/Net/HTTP.pm +++ b/Master/tlpkg/tlperl/lib/Net/HTTP.pm @@ -3,10 +3,19 @@ package Net::HTTP; use strict; use vars qw($VERSION @ISA $SOCKET_CLASS); -$VERSION = "6.06"; +$VERSION = "6.07"; unless ($SOCKET_CLASS) { - eval { require IO::Socket::INET } || require IO::Socket; - $SOCKET_CLASS = "IO::Socket::INET"; + # Try several, in order of capability and preference + if (eval { require IO::Socket::IP }) { + $SOCKET_CLASS = "IO::Socket::IP"; # IPv4+IPv6 + } elsif (eval { require IO::Socket::INET6 }) { + $SOCKET_CLASS = "IO::Socket::INET6"; # IPv4+IPv6 + } elsif (eval { require IO::Socket::INET }) { + $SOCKET_CLASS = "IO::Socket::INET"; # IPv4 only + } else { + require IO::Socket; + $SOCKET_CLASS = "IO::Socket::INET"; + } } require Net::HTTP::Methods; require Carp; @@ -59,10 +68,11 @@ C<Net::HTTP> class represents a connection to an HTTP server. The HTTP protocol is described in RFC 2616. The C<Net::HTTP> class supports C<HTTP/1.0> and C<HTTP/1.1>. -C<Net::HTTP> is a sub-class of C<IO::Socket::INET>. You can mix the -methods described below with reading and writing from the socket -directly. This is not necessary a good idea, unless you know what you -are doing. +C<Net::HTTP> is a sub-class of one of C<IO::Socket::IP> (IPv6+IPv4), +C<IO::Socket::INET6> (IPv6+IPv4), or C<IO::Socket::INET> (IPv4 only). +You can mix the methods described below with reading and writing from the +socket directly. This is not necessary a good idea, unless you know what +you are doing. The following methods are provided (in addition to those of C<IO::Socket::INET>): @@ -84,6 +94,9 @@ C<IO::Socket::INET>'s as well as these: The C<Host> option is also the default for C<IO::Socket::INET>'s C<PeerAddr>. The C<PeerPort> defaults to 80 if not provided. +The C<PeerPort> specification can also be embedded in the C<PeerAddr> +by preceding it with a ":", and closing the IPv6 address on bracktes "[]" if +necessary: "192.0.2.1:80","[2001:db8::1]:80","any.example.com:80". The C<Listen> option provided by C<IO::Socket::INET>'s constructor method is not allowed. |