Update Socket to CPAN version 2.013
authorChris 'BinGOs' Williams <chris@bingosnet.co.uk>
Mon, 28 Oct 2013 22:38:11 +0000 (22:38 +0000)
committerChris 'BinGOs' Williams <chris@bingosnet.co.uk>
Mon, 28 Oct 2013 22:38:11 +0000 (22:38 +0000)
  [DELTA]

2.013   2031/10/28 00:49:43
        [BUGFIXES]
         * Unit-test bugfixes for VMS (RT89766):
            + Need to pass protocol => IPPROTO_TCP to avoid SCTP as well
            + Perform AI_NUMERICHOST test against non-"localhost"
            + May have to set NI_NUMERICSERV flag if it fails without

Porting/Maintainers.pl
cpan/Socket/Socket.pm
cpan/Socket/t/getaddrinfo.t
cpan/Socket/t/getnameinfo.t

index 19dc4f4..1564559 100755 (executable)
@@ -998,7 +998,7 @@ use File::Glob qw(:case);
     },
 
     'Socket' => {
-        'DISTRIBUTION' => 'PEVANS/Socket-2.012.tar.gz',
+        'DISTRIBUTION' => 'PEVANS/Socket-2.013.tar.gz',
         'FILES'        => q[cpan/Socket],
     },
 
index ed41f2a..438f11a 100644 (file)
@@ -3,7 +3,7 @@ package Socket;
 use strict;
 { use 5.006001; }
 
-our $VERSION = '2.012';
+our $VERSION = '2.013';
 
 =head1 NAME
 
index e4ae57c..b1b1911 100644 (file)
@@ -54,8 +54,8 @@ cmp_ok( $err, "==", 0, '$err == 0 for host=127.0.0.1/service=undef' );
        '$res[0] addr is {"127.0.0.1", ??}' );
 }
 
-( $err, @res ) = getaddrinfo( "", "80", { family => AF_INET, socktype => SOCK_STREAM } );
-cmp_ok( $err, "==", 0, '$err == 0 for service=80/family=AF_INET/socktype=STREAM' );
+( $err, @res ) = getaddrinfo( "", "80", { family => AF_INET, socktype => SOCK_STREAM, protocol => IPPROTO_TCP } );
+cmp_ok( $err, "==", 0, '$err == 0 for service=80/family=AF_INET/socktype=STREAM/protocol=IPPROTO_TCP' );
 is( scalar @res, 1, '@res has 1 result' );
 
 # Just pick the first one
@@ -102,8 +102,12 @@ SKIP: {
 
 # Now check that names with AI_NUMERICHOST fail
 
-( $err, @res ) = getaddrinfo( "localhost", "ftp", { flags => AI_NUMERICHOST, socktype => SOCK_STREAM } );
-ok( $err != 0, '$err != 0 for host=localhost/service=ftp/flags=AI_NUMERICHOST/socktype=SOCK_STREAM' );
+SKIP: {
+    skip "Resolver has no answer for $goodhost", 1 unless gethostbyname( $goodhost );
+
+    ( $err, @res ) = getaddrinfo( $goodhost, "ftp", { flags => AI_NUMERICHOST, socktype => SOCK_STREAM } );
+    ok( $err != 0, "\$err != 0 for host=$goodhost/service=ftp/flags=AI_NUMERICHOST/socktype=SOCK_STREAM" );
+}
 
 # Some sanity checking on the hints hash
 ok( defined eval { getaddrinfo( "127.0.0.1", "80", undef ); 1 },
index ca24e2c..035b345 100644 (file)
@@ -32,11 +32,15 @@ is( $host, $expect_host, "\$host is $expect_host for NS" );
 is( $service, "80", '$service is 80 for NS' );
 
 # Probably "www" but we'd better ask the system to be sure
+my $flags = NI_NUMERICHOST;
 my $expect_service = getservbyport( 80, "tcp" );
-defined $expect_service or $expect_service = "80";
+unless( defined $expect_service ) {
+    $expect_service = "80";
+    $flags |= NI_NUMERICSERV; # don't seem to have a service name
+}
 
-( $err, $host, $service ) = getnameinfo( pack_sockaddr_in( 80, inet_aton( "127.0.0.1" ) ), NI_NUMERICHOST );
-cmp_ok( $err, "==", 0, '$err == 0 for {family=AF_INET,port=80,sinaddr=127.0.0.1}/NI_NUMERICHOST' );
+( $err, $host, $service ) = getnameinfo( pack_sockaddr_in( 80, inet_aton( "127.0.0.1" ) ), $flags );
+cmp_ok( $err, "==", 0, '$err == 0 for {family=AF_INET,port=80,sinaddr=127.0.0.1}/NI_NUMERICHOST[|NI_NUMERICSERV]' );
 
 is( $host, "127.0.0.1", '$host is 127.0.0.1 for NH' );
 is( $service, $expect_service, "\$service is $expect_service for NH" );