},
'IO::Socket::IP' => {
- 'DISTRIBUTION' => 'PEVANS/IO-Socket-IP-0.28.tar.gz',
+ 'DISTRIBUTION' => 'PEVANS/IO-Socket-IP-0.29.tar.gz',
'FILES' => q[cpan/IO-Socket-IP],
'EXCLUDED' => [
qr{^examples/},
Revision history for IO-Socket-IP
+0.29 2014/02/24 16:06:29
+ [BUGFIXES]
+ * Workaround for OSes that disobey AI_ADDRCONFIG and yield AIs on
+ families the kernel will not support anyway (e.g. HPUX)
+ * Workaround for OSes that lack getprotobyname() (e.g. Android)
+
0.28 2014/02/10 16:17:59
[CHANGES]
* Renamed internal _configure method to _io_socket_ip__configure to
"Paul Evans <leonerd@leonerd.org.uk>"
],
"dynamic_config" : 1,
- "generated_by" : "Module::Build version 0.4203",
+ "generated_by" : "Module::Build version 0.4204",
"license" : [
"perl_5"
],
"provides" : {
"IO::Socket::IP" : {
"file" : "lib/IO/Socket/IP.pm",
- "version" : "0.28"
+ "version" : "0.29"
}
},
"release_status" : "stable",
"http://dev.perl.org/licenses/"
]
},
- "version" : "0.28"
+ "version" : "0.29"
}
author:
- 'Paul Evans <leonerd@leonerd.org.uk>'
build_requires:
- Test::More: 0.88
+ Test::More: '0.88'
dynamic_config: 1
-generated_by: 'Module::Build version 0.4203, CPAN::Meta::Converter version 2.133380'
+generated_by: 'Module::Build version 0.4204, CPAN::Meta::Converter version 2.133380'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
- version: 1.4
+ version: '1.4'
name: IO-Socket-IP
provides:
IO::Socket::IP:
file: lib/IO/Socket/IP.pm
- version: 0.28
+ version: '0.29'
requires:
- IO::Socket: 0
- Socket: 1.97
+ IO::Socket: '0'
+ Socket: '1.97'
resources:
license: http://dev.perl.org/licenses/
-version: 0.28
+version: '0.29'
-# Note: this file was auto-generated by Module::Build::Compat version 0.4203
+# Note: this file was auto-generated by Module::Build::Compat version 0.4204
use ExtUtils::MakeMaker;
WriteMakefile
(
# $VERSION needs to be set before use base 'IO::Socket'
# - https://rt.cpan.org/Ticket/Display.html?id=92107
BEGIN {
- $VERSION = '0.28';
+ $VERSION = '0.29';
}
use strict;
use constant HAVE_MSWIN32 => ( $^O eq "MSWin32" );
+# At least one OS (Android) is known not to have getprotobyname()
+use constant HAVE_GETPROTOBYNAME => defined eval { getprotobyname( "tcp" ) };
+
my $IPv6_re = do {
# translation of RFC 3986 3.2.2 ABNF to re
my $IPv4address = do {
if( defined( my $proto = $arg->{Proto} ) ) {
unless( $proto =~ m/^\d+$/ ) {
- my $protonum = getprotobyname( $proto );
+ my $protonum = HAVE_GETPROTOBYNAME
+ ? getprotobyname( $proto )
+ : eval { Socket->${\"IPPROTO_\U$proto"}() };
defined $protonum or croak "Unrecognised protocol $proto";
$proto = $protonum;
}
if( !@infos ) {
# If there was a Family hint then create a plain unbound, unconnected socket
+ if( defined $hints{family} ) {
+ @infos = ( {
+ family => $hints{family},
+ socktype => $hints{socktype},
+ protocol => $hints{protocol},
+ } );
+ }
# If there wasn't, use getaddrinfo()'s AI_ADDRCONFIG side-effect to guess a
# suitable family first.
- if( !defined $hints{family} ) {
- my ( $err, $addrinfo ) = getaddrinfo( "", "0", \%hints );
+ else {
+ ( my $err, @infos ) = getaddrinfo( "", "0", \%hints );
if( $err ) {
$@ = "$err";
$! = EINVAL;
return;
}
- $hints{family} = $addrinfo->{family};
+ # We'll take all the @infos anyway, because some OSes (HPUX) are known to
+ # ignore the AI_ADDRCONFIG hint and return AF_INET6 even if they don't
+ # support them
}
-
- @infos = ( {
- family => $hints{family},
- socktype => $hints{socktype},
- protocol => $hints{protocol},
- } );
}
# In the nonblocking case, caller will be calling ->setup multiple times.
{
my $sock = IO::Socket::IP->new( Family => AF_INET );
+ my $save_exc = $@;
+ ok( defined $sock, 'Constructor yields handle for Family => AF_INET' ) or
+ diag( "Exception was $save_exc" );
ok( defined $sock->fileno, '$sock->fileno for Family => AF_INET' );
is( $sock->sockdomain, AF_INET, '$sock->sockdomain for Family => AF_INET' );
SKIP: {
my $AF_INET6 = eval { require Socket and Socket::AF_INET6() } or
- skip "No AF_INET6", 3;
+ skip "No AF_INET6", 4;
eval { IO::Socket::IP->new( LocalHost => "::1" ) } or
- skip "Unable to bind to ::1", 3;
+ skip "Unable to bind to ::1", 4;
my $sock = IO::Socket::IP->new( Family => $AF_INET6 );
+ my $save_exc = $@;
+ ok( defined $sock, 'Constructor yields handle for Family => AF_INET6' ) or
+ diag( "Exception was $save_exc" );
ok( defined $sock->fileno, '$sock->fileno for Family => AF_INET6' );
is( $sock->sockdomain, $AF_INET6, '$sock->sockdomain for Family => AF_INET6' );
# what family
{
my $sock = IO::Socket::IP->new( Type => SOCK_STREAM );
+ my $save_exc = $@;
+ ok( defined $sock, 'Constructor yields handle for Type => SOCK_STREAM' ) or
+ diag( "Exception was $save_exc" );
ok( defined $sock->fileno, '$sock->fileno for Type => SOCK_STREAM' );
is( $sock->socktype, SOCK_STREAM, '$sock->socktype for Type => SOCK_STREAM' );