This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Revert "Upgrade Socket from 2.020 to 2.021"
authorSteve Hay <steve.m.hay@googlemail.com>
Thu, 17 Dec 2015 11:08:16 +0000 (11:08 +0000)
committerSteve Hay <steve.m.hay@googlemail.com>
Thu, 17 Dec 2015 11:08:16 +0000 (11:08 +0000)
This reverts commit 0bd66ca801c5fb84ee6a8feeb8114f0d8248029f.

Worked for me, but Jenkins isn't happy :-(

Porting/Maintainers.pl
cpan/Socket/Makefile.PL
cpan/Socket/Socket.pm
cpan/Socket/Socket.xs
cpan/Socket/t/getaddrinfo.t
t/porting/customized.dat

index eb1b554..bb6af71 100755 (executable)
@@ -987,8 +987,12 @@ use File::Glob qw(:case);
     },
 
     'Socket' => {
-        'DISTRIBUTION' => 'PEVANS/Socket-2.021.tar.gz',
+        'DISTRIBUTION' => 'PEVANS/Socket-2.020.tar.gz',
         'FILES'        => q[cpan/Socket],
+
+        # https://rt.cpan.org/Ticket/Display.html?id=106797
+        # https://rt.cpan.org/Ticket/Display.html?id=107058
+        'CUSTOMIZED'   => [ qw[ Socket.pm Socket.xs ] ],
     },
 
     'Storable' => {
index 44e51a2..3bad655 100644 (file)
@@ -14,7 +14,7 @@ sub check_for
 {
     my %args = @_;
     return if $ENV{PERL_CORE};
-    return if defined $args{confkey} and defined $Config{$args{confkey}};
+    return if defined $Config{$args{confkey}};
 
     require ExtUtils::CBuilder;
     $cb ||= ExtUtils::CBuilder->new( quiet => 1 );
@@ -77,13 +77,12 @@ sub check_for_func
 }
 
 my %defines = (
-    # -Dfoo                func()         $Config{key}
-    HAS_GETADDRINFO  => [ "getaddrinfo",  "d_getaddrinfo" ],
-    HAS_GETNAMEINFO  => [ "getnameinfo",  "d_getnameinfo" ],
-    HAS_GAI_STRERROR => [ "gai_strerror" ],
-    HAS_INET_ATON    => [ "inet_aton",    "d_inetaton" ],
-    HAS_INETNTOP     => [ "inet_ntop",    "d_inetntop" ],
-    HAS_INETPTON     => [ "inet_pton",    "d_inetpton" ],
+    # -Dfoo               func()        $Config{key}
+    HAS_GETADDRINFO => [ "getaddrinfo", "d_getaddrinfo" ],
+    HAS_GETNAMEINFO => [ "getnameinfo", "d_getnameinfo" ],
+    HAS_INET_ATON   => [ "inet_aton",   "d_inetaton" ],
+    HAS_INETNTOP    => [ "inet_ntop",   "d_inetntop" ],
+    HAS_INETPTON    => [ "inet_pton",   "d_inetpton" ],
 );
 
 foreach my $define ( sort keys %defines ) {
@@ -190,9 +189,8 @@ my @names = (
        IPV6_MULTICAST_IF IPV6_MULTICAST_LOOP IPV6_UNICAST_HOPS IPV6_V6ONLY
 
        MSG_BCAST MSG_BTAG MSG_CTLFLAGS MSG_CTLIGNORE MSG_DONTWAIT MSG_EOF
-       MSG_EOR MSG_ERRQUEUE MSG_ETAG MSG_FASTOPEN MSG_FIN MSG_MAXIOVLEN
-       MSG_MCAST MSG_NOSIGNAL MSG_RST MSG_SYN MSG_TRUNC MSG_URG MSG_WAITALL
-       MSG_WIRE
+       MSG_EOR MSG_ERRQUEUE MSG_ETAG MSG_FIN MSG_MAXIOVLEN MSG_MCAST
+       MSG_NOSIGNAL MSG_RST MSG_SYN MSG_TRUNC MSG_URG MSG_WAITALL MSG_WIRE
 
        NI_DGRAM NI_IDN NI_IDN_ALLOW_UNASSIGNED NI_IDN_USE_STD3_ASCII_RULES
        NI_NAMEREQD NI_NOFQDN NI_NUMERICHOST NI_NUMERICSERV
@@ -222,11 +220,11 @@ my @names = (
        SO_SECURITY_ENCRYPTION_TRANSPORT SO_SNDBUF SO_SNDLOWAT SO_SNDTIMEO
        SO_STATE SO_TIMESTAMP SO_TYPE SO_USELOOPBACK SO_XOPEN SO_XSE
 
-       TCP_CONGESTION TCP_CONNECTIONTIMEOUT TCP_CORK TCP_DEFER_ACCEPT
-       TCP_FASTOPEN TCP_INFO TCP_INIT_CWND TCP_KEEPALIVE TCP_KEEPCNT
-       TCP_KEEPIDLE TCP_KEEPINTVL TCP_LINGER2 TCP_MAXRT TCP_MAXSEG
-       TCP_MD5SIG TCP_NODELAY TCP_NOOPT TCP_NOPUSH TCP_QUICKACK
-       TCP_SACK_ENABLE TCP_STDURG TCP_SYNCNT TCP_WINDOW_CLAMP
+       TCP_CONGESTION TCP_CONNECTIONTIMEOUT TCP_CORK TCP_DEFER_ACCEPT TCP_INFO
+       TCP_INIT_CWND TCP_KEEPALIVE TCP_KEEPCNT TCP_KEEPIDLE TCP_KEEPINTVL
+       TCP_LINGER2 TCP_MAXRT TCP_MAXSEG TCP_MD5SIG TCP_NODELAY TCP_NOOPT
+       TCP_NOPUSH TCP_QUICKACK TCP_SACK_ENABLE TCP_STDURG TCP_SYNCNT
+       TCP_WINDOW_CLAMP
 
        UIO_MAXIOV
     ),
index 591791e..dd89450 100644 (file)
@@ -3,7 +3,7 @@ package Socket;
 use strict;
 { use 5.006001; }
 
-our $VERSION = '2.021';
+our $VERSION = '2.020_02'; # patched in perl5.git
 
 =head1 NAME
 
@@ -384,7 +384,7 @@ Restrict to only generating addresses for this protocol
 The return value will be a list; the first value being an error indication,
 followed by a list of address structures (if no error occurred).
 
-The error value will be a dualvar; comparable to the C<EAI_*> error constants,
+The error value will be a dualvar; comparable to the C<EI_*> error constants,
 or printable as a human-readable error message string. If no error occurred it
 will be zero numerically and an empty string.
 
@@ -452,7 +452,7 @@ constants, or defaults to 0 if unspecified.
 The return value will be a list; the first value being an error condition,
 followed by the hostname and service name.
 
-The error value will be a dualvar; comparable to the C<EAI_*> error constants,
+The error value will be a dualvar; comparable to the C<EI_*> error constants,
 or printable as a human-readable error message string. The host and service
 names will be plain strings.
 
@@ -726,7 +726,7 @@ our @EXPORT = qw(
        IP_RETOPTS
 
        MSG_BCAST MSG_BTAG MSG_CTLFLAGS MSG_CTLIGNORE MSG_CTRUNC MSG_DONTROUTE
-       MSG_DONTWAIT MSG_EOF MSG_EOR MSG_ERRQUEUE MSG_ETAG MSG_FASTOPEN MSG_FIN
+       MSG_DONTWAIT MSG_EOF MSG_EOR MSG_ERRQUEUE MSG_ETAG MSG_FIN
        MSG_MAXIOVLEN MSG_MCAST MSG_NOSIGNAL MSG_OOB MSG_PEEK MSG_PROXY MSG_RST
        MSG_SYN MSG_TRUNC MSG_URG MSG_WAITALL MSG_WIRE
 
@@ -766,11 +766,11 @@ our @EXPORT_OK = qw(
 
        IPTOS_LOWDELAY IPTOS_THROUGHPUT IPTOS_RELIABILITY IPTOS_MINCOST
 
-       TCP_CONGESTION TCP_CONNECTIONTIMEOUT TCP_CORK TCP_DEFER_ACCEPT
-       TCP_FASTOPEN TCP_INFO TCP_INIT_CWND TCP_KEEPALIVE TCP_KEEPCNT
-       TCP_KEEPIDLE TCP_KEEPINTVL TCP_LINGER2 TCP_MAXRT TCP_MAXSEG
-       TCP_MD5SIG TCP_NODELAY TCP_NOOPT TCP_NOPUSH TCP_QUICKACK
-       TCP_SACK_ENABLE TCP_STDURG TCP_SYNCNT TCP_WINDOW_CLAMP
+       TCP_CONGESTION TCP_CONNECTIONTIMEOUT TCP_CORK TCP_DEFER_ACCEPT TCP_INFO
+       TCP_INIT_CWND TCP_KEEPALIVE TCP_KEEPCNT TCP_KEEPIDLE TCP_KEEPINTVL
+       TCP_LINGER2 TCP_MAXRT TCP_MAXSEG TCP_MD5SIG TCP_NODELAY TCP_NOOPT
+       TCP_NOPUSH TCP_QUICKACK TCP_SACK_ENABLE TCP_STDURG TCP_SYNCNT
+       TCP_WINDOW_CLAMP
 
        IN6ADDR_ANY IN6ADDR_LOOPBACK
 
index 9761631..52df483 100644 (file)
@@ -473,65 +473,6 @@ not_here(const char *s)
 
 #include "const-c.inc"
 
-#if defined(HAS_GETADDRINFO) && !defined(HAS_GAI_STRERROR)
-static const char *gai_strerror(int err)
-{
-  switch (err)
-  {
-#ifdef EAI_ADDRFAMILY
-  case EAI_ADDRFAMILY:
-    return "Address family for hostname is not supported.";
-#endif
-#ifdef EAI_AGAIN
-  case EAI_AGAIN:
-    return "The name could not be resolved at this time.";
-#endif
-#ifdef EAI_BADFLAGS
-  case EAI_BADFLAGS:
-    return "The flags parameter has an invalid value.";
-#endif
-#ifdef EAI_FAIL
-  case EAI_FAIL:
-    return "A non-recoverable error occurred while resolving the name.";
-#endif
-#ifdef EAI_FAMILY
-  case EAI_FAMILY:
-    return "The address family was not recognized or length is invalid.";
-#endif
-#ifdef EAI_MEMORY
-  case EAI_MEMORY:
-    return "A memory allocation failure occurred.";
-#endif
-#ifdef EAI_NODATA
-  case EAI_NODATA:
-    return "No address is associated with the hostname.";
-#endif
-#ifdef EAI_NONAME
-  case EAI_NONAME:
-    return "The name does not resolve for the supplied parameters.";
-#endif
-#ifdef EAI_OVERFLOW
-  case EAI_OVERFLOW:
-    return "An argument buffer overflowed.";
-#endif
-#ifdef EAI_SERVICE
-  case EAI_SERVICE:
-    return "The service parameter was not recognized for the specified socket type.";
-#endif
-#ifdef EAI_SOCKTYPE
-  case EAI_SOCKTYPE:
-    return "The specified socket type was not recognized.";
-#endif
-#ifdef EAI_SYSTEM
-  case EAI_SYSTEM:
-    return "A system error occurred - see errno.";
-#endif
-  default:
-    return "Unknown error in getaddrinfo().";
-  }
-}
-#endif
-
 #ifdef HAS_GETADDRINFO
 static SV *err_to_SV(pTHX_ int err)
 {
@@ -752,13 +693,13 @@ inet_aton(host)
                ST(0) = sv_2mortal(newSVpvn((char *)&ip_address, sizeof(ip_address)));
                XSRETURN(1);
        }
-#ifdef HAS_GETHOSTBYNAME
+
        phe = gethostbyname(host);
        if (phe && phe->h_addrtype == AF_INET && phe->h_length == 4) {
                ST(0) = sv_2mortal(newSVpvn((char *)phe->h_addr, phe->h_length));
                XSRETURN(1);
        }
-#endif
+
        XSRETURN_UNDEF;
        }
 
index b33a3e7..6f8a324 100644 (file)
@@ -22,8 +22,8 @@ ok( defined $res[0]->{addr},
     '$res[0] addr is defined' );
 if (length $res[0]->{addr}) {
     is_deeply( [ unpack_sockaddr_in $res[0]->{addr} ],
-               [ 80, inet_aton( "127.0.0.1" ) ],
-               '$res[0] addr is {"127.0.0.1", 80}' );
+              [ 80, inet_aton( "127.0.0.1" ) ],
+              '$res[0] addr is {"127.0.0.1", 80}' );
 } else {
     fail( '$res[0] addr is empty: check $socksizetype' );
 }
@@ -50,8 +50,8 @@ cmp_ok( $err, "==", 0, '$err == 0 for host=127.0.0.1/service=undef' );
     cmp_ok( $err, "==", 0, '$err == 0 for host=$1' );
     ok( scalar @res > 0, '@res has results' );
     is( (unpack_sockaddr_in $res[0]->{addr})[1],
-        inet_aton( "127.0.0.1" ),
-        '$res[0] addr is {"127.0.0.1", ??}' );
+       inet_aton( "127.0.0.1" ),
+       '$res[0] addr is {"127.0.0.1", ??}' );
 }
 
 ( $err, @res ) = getaddrinfo( "", "80", { family => AF_INET, socktype => SOCK_STREAM, protocol => IPPROTO_TCP } );
@@ -90,13 +90,13 @@ SKIP: {
     # Some OSes return $err == 0 but no results
     ( $err, @res ) = getaddrinfo( $missinghost, "ftp", { socktype => SOCK_STREAM } );
     ok( $err != 0 || ( $err == 0 && @res == 0 ),
-        '$err != 0 or @res == 0 for host=TbK4jM2M0OS.lm57DWIyu4i/service=ftp/socktype=SOCK_STREAM' );
+       '$err != 0 or @res == 0 for host=TbK4jM2M0OS.lm57DWIyu4i/service=ftp/socktype=SOCK_STREAM' );
     if( @res ) {
-        # Diagnostic that might help
-        while( my $r = shift @res ) {
-            diag( "family=$r->{family} socktype=$r->{socktype} protocol=$r->{protocol} addr=[" . length( $r->{addr} ) . " bytes]" );
-            diag( "  addr=" . join( ", ", map { sprintf '0x%02x', ord $_ } split m//, $r->{addr} ) );
-        }
+       # Diagnostic that might help
+       while( my $r = shift @res ) {
+           diag( "family=$r->{family} socktype=$r->{socktype} protocol=$r->{protocol} addr=[" . length( $r->{addr} ) . " bytes]" );
+           diag( "  addr=" . join( ", ", map { sprintf '0x%02x', ord $_ } split m//, $r->{addr} ) );
+       }
     }
 }
 
@@ -112,11 +112,11 @@ AI_NUMERICHOST: {
     # for enabled services but that's kind of yuck, too.
     my @port = (80, 7, 22, 25, 88, 123, 110, 389, 443, 445, 873, 2049, 3306);
     foreach my $port ( @port ) {
-        ( $err, @res ) = getaddrinfo( "127.0.0.1", $port, { flags => AI_NUMERICHOST, socktype => SOCK_STREAM } );
-        if( $err == 0 ) {
-            ok( $err == 0, "\$err == 0 for 127.0.0.1/$port/flags=AI_NUMERICHOST" );
-            last AI_NUMERICHOST;
-        }
+       ( $err, @res ) = getaddrinfo( "127.0.0.1", $port, { flags => AI_NUMERICHOST, socktype => SOCK_STREAM } );
+       if( $err == 0 ) {
+           ok( $err == 0, "\$err == 0 for 127.0.0.1/$port/flags=AI_NUMERICHOST" );
+           last AI_NUMERICHOST;
+       }
     }
     fail( "$err for 127.0.0.1/$port[-1]/flags=AI_NUMERICHOST (failed for ports @port)" );
 }
index 73470ab..60047a5 100644 (file)
@@ -14,6 +14,8 @@ Scalar-List-Utils cpan/Scalar-List-Utils/lib/List/Util/XS.pm 08abbe1a707927cee53
 Scalar-List-Utils cpan/Scalar-List-Utils/lib/Scalar/Util.pm 7f1e6eb11105623200ef9cdcb881545ccb769ded
 Scalar-List-Utils cpan/Scalar-List-Utils/lib/Sub/Util.pm d87811528ae3587f04e2f09894b8c88471754386
 Scalar-List-Utils cpan/Scalar-List-Utils/ListUtil.xs ed25abc419771d6f3f12323f1f0a372f043d51b2
+Socket cpan/Socket/Socket.pm bdc42a2bd5cb560ed1120a3e6f408ed7ece14dce
+Socket cpan/Socket/Socket.xs 6102315291684e56e360ff5e0dd237c9394c49b8
 Win32API::File cpan/Win32API-File/buffers.h 02d230ac9ac7091365128161a0ed671898baefae
 Win32API::File cpan/Win32API-File/cFile.h fca7e383e76979c3ac3adf12d11d1bcd2618e489
 Win32API::File cpan/Win32API-File/cFile.pc 992421eea7782a5957b64f66764f6ffb5093bee4