Projects
Mega:23.09
perl-IO-Socket-IP
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 3
View file
_service:tar_scm:perl-IO-Socket-IP.spec
Changed
@@ -1,6 +1,6 @@ Name: perl-IO-Socket-IP -Version: 0.41 -Release: 3 +Version: 0.42 +Release: 1 Summary: Drop-in replacement for IO::Socket::INET supporting both IPv4 and IPv6 License: GPL+ or Artistic-1.0 URL: https://metacpan.org/release/IO-Socket-IP @@ -54,6 +54,12 @@ %changelog +* Mon Jan 29 2024 dongyuzhen <dongyuzhen@h-partners.com> - 0.42-1 +- upgrade version to 0.42: + - updated for Perl v5.14 - use `package NAME VERSION` syntax + - fix typo 'behvior' + - fix for DragonflyBSD and IPV6_V6ONLY from core perl + * Tue Oct 25 2022 dongyuzhen <dongyuzhen@h-partners.com> - 0.41-3 - Type:bugfix - ID:NA
View file
_service
Changed
@@ -2,7 +2,7 @@ <service name="tar_scm"> <param name="url">git@gitee.com:src-openeuler/perl-IO-Socket-IP.git</param> <param name="scm">git</param> - <param name="revision">openEuler-23.09</param> + <param name="revision">master</param> <param name="exclude">*</param> <param name="extract">*</param> </service>
View file
_service:tar_scm:IO-Socket-IP-0.42.tar.gz/.editorconfig
Added
@@ -0,0 +1,4 @@ +root = true + +*.{pm,pl,t} +indent_size = 3
View file
_service:tar_scm:IO-Socket-IP-0.41.tar.gz/Build.PL -> _service:tar_scm:IO-Socket-IP-0.42.tar.gz/Build.PL
Changed
@@ -7,6 +7,8 @@ my $build = Module::Build->new( module_name => 'IO::Socket::IP', requires => { + 'perl' => '5.014', + 'IO::Socket' => 0, 'Socket' => '1.97', },
View file
_service:tar_scm:IO-Socket-IP-0.41.tar.gz/Changes -> _service:tar_scm:IO-Socket-IP-0.42.tar.gz/Changes
Changed
@@ -1,5 +1,15 @@ Revision history for IO-Socket-IP +0.42 2023-07-25 + CHANGES + * Put error string in `$IO::Socket::errstr` as done by + IO::Socket v1.45 + * Updated for Perl v5.14 - use `package NAME VERSION` syntax + + BUGFIXES + * Fix typo 'behvior' (RT133467) (thanks ferivoz@riseup.net) + * Fix for DragonflyBSD and IPV6_V6ONLY from core perl (RT148293) + 0.41 2020-09-15 16:59 CHANGES * Updated to `=head2 barename` documentation style
View file
_service:tar_scm:IO-Socket-IP-0.41.tar.gz/LICENSE -> _service:tar_scm:IO-Socket-IP-0.42.tar.gz/LICENSE
Changed
@@ -1,4 +1,4 @@ -This software is copyright (c) 2020 by Paul Evans <leonerd@leonerd.org.uk>. +This software is copyright (c) 2023 by Paul Evans <leonerd@leonerd.org.uk>. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. @@ -12,7 +12,7 @@ --- The GNU General Public License, Version 1, February 1989 --- -This software is Copyright (c) 2020 by Paul Evans <leonerd@leonerd.org.uk>. +This software is Copyright (c) 2023 by Paul Evans <leonerd@leonerd.org.uk>. This is free software, licensed under: @@ -272,7 +272,7 @@ --- The Artistic License 1.0 --- -This software is Copyright (c) 2020 by Paul Evans <leonerd@leonerd.org.uk>. +This software is Copyright (c) 2023 by Paul Evans <leonerd@leonerd.org.uk>. This is free software, licensed under: @@ -292,21 +292,21 @@ - "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through - textual modification. + textual modification. - "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright - Holder. + Holder. - "Copyright Holder" is whoever is named in the copyright or copyrights for - the package. + the package. - "You" is you, if you're thinking about copying or distributing this Package. - "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the - computing community at large as a market that must bear the fee.) + computing community at large as a market that must bear the fee.) - "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they - received it. + received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you @@ -373,7 +373,7 @@ 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF -MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End
View file
_service:tar_scm:IO-Socket-IP-0.41.tar.gz/MANIFEST -> _service:tar_scm:IO-Socket-IP-0.42.tar.gz/MANIFEST
Changed
@@ -1,13 +1,10 @@ +.editorconfig Build.PL Changes examples/connect.pl examples/nonblocking_libasyncns.pl lib/IO/Socket/IP.pm -LICENSE MANIFEST This list of files -META.json -META.yml -README t/00use.t t/01local-client-v4.t t/02local-server-v4.t @@ -31,3 +28,7 @@ t/30nonblocking-connect.t t/31nonblocking-connect-internet.t t/99pod.t +README +LICENSE +META.yml +META.json
View file
_service:tar_scm:IO-Socket-IP-0.41.tar.gz/META.json -> _service:tar_scm:IO-Socket-IP-0.42.tar.gz/META.json
Changed
@@ -22,7 +22,8 @@ "runtime" : { "requires" : { "IO::Socket" : "0", - "Socket" : "1.97" + "Socket" : "1.97", + "perl" : "5.014" } }, "test" : { @@ -34,7 +35,7 @@ "provides" : { "IO::Socket::IP" : { "file" : "lib/IO/Socket/IP.pm", - "version" : "0.41" + "version" : "0.42" } }, "release_status" : "stable", @@ -43,6 +44,6 @@ "http://dev.perl.org/licenses/" }, - "version" : "0.41", - "x_serialization_backend" : "JSON::PP version 4.05" + "version" : "0.42", + "x_serialization_backend" : "JSON::PP version 4.07" }
View file
_service:tar_scm:IO-Socket-IP-0.41.tar.gz/META.yml -> _service:tar_scm:IO-Socket-IP-0.42.tar.gz/META.yml
Changed
@@ -16,11 +16,12 @@ provides: IO::Socket::IP: file: lib/IO/Socket/IP.pm - version: '0.41' + version: '0.42' requires: IO::Socket: '0' Socket: '1.97' + perl: '5.014' resources: license: http://dev.perl.org/licenses/ -version: '0.41' +version: '0.42' x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
View file
_service:tar_scm:IO-Socket-IP-0.41.tar.gz/README -> _service:tar_scm:IO-Socket-IP-0.42.tar.gz/README
Changed
@@ -4,19 +4,19 @@ SYNOPSIS - use IO::Socket::IP; + use IO::Socket::IP; - my $sock = IO::Socket::IP->new( - PeerHost => "www.google.com", - PeerPort => "http", - Type => SOCK_STREAM, - ) or die "Cannot construct socket - $@"; + my $sock = IO::Socket::IP->new( + PeerHost => "www.google.com", + PeerPort => "http", + Type => SOCK_STREAM, + ) or die "Cannot construct socket - $IO::Socket::errstr"; - my $familyname = ( $sock->sockdomain == PF_INET6 ) ? "IPv6" : - ( $sock->sockdomain == PF_INET ) ? "IPv4" : - "unknown"; + my $familyname = ( $sock->sockdomain == PF_INET6 ) ? "IPv6" : + ( $sock->sockdomain == PF_INET ) ? "IPv4" : + "unknown"; - printf "Connected to google via %s\n", $familyname; + printf "Connected to google via %s\n", $familyname; DESCRIPTION @@ -42,15 +42,15 @@ IO::Socket constructor with either PF_INET or PF_INET6 as the Domain parameter will yield an IO::Socket::IP object. - use IO::Socket::IP -register; + use IO::Socket::IP -register; - my $sock = IO::Socket->new( - Domain => PF_INET6, - LocalHost => "::1", - Listen => 1, - ) or die "Cannot create socket - $@\n"; + my $sock = IO::Socket->new( + Domain => PF_INET6, + LocalHost => "::1", + Listen => 1, + ) or die "Cannot create socket - $IO::Socket::errstr\n"; - print "Created a socket of type " . ref($sock) . "\n"; + print "Created a socket of type " . ref($sock) . "\n"; Note that -register is a global setting that applies to the entire program; it cannot be applied only for certain callers, removed, or @@ -171,10 +171,10 @@ For example, both options given below are equivalent to setting ReuseAddr. - Sockopts => - SOL_SOCKET, SO_REUSEADDR , - SOL_SOCKET, SO_REUSEADDR, pack( "i", 1 ) , - + Sockopts => + SOL_SOCKET, SO_REUSEADDR , + SOL_SOCKET, SO_REUSEADDR, pack( "i", 1 ) , + V6Only => BOOL @@ -193,12 +193,12 @@ disable it. To determine whether it is possible to disable, you may use the class method - if( IO::Socket::IP->CAN_DISABLE_V6ONLY ) { - ... - } - else { - ... - } + if( IO::Socket::IP->CAN_DISABLE_V6ONLY ) { + ... + } + else { + ... + } If your platform does not support disabling this option but you still want to listen for both AF_INET and AF_INET6 connections you will @@ -232,7 +232,7 @@ timeout does not apply to the initial hostname resolve operation, if connecting by hostname. - This behviour is copied inspired by IO::Socket::INET; for more fine + This behaviour is copied inspired by IO::Socket::INET; for more fine grained control over connection timeouts, consider performing a nonblocking connect directly. @@ -247,9 +247,9 @@ with the AI_ADDRCONFIG flag, no host name, and a service name of "0", and uses the family of the first returned result. - If the constructor fails, it will set $@ to an appropriate error - message; this may be from $! or it may be some other string; not every - failure necessarily has an associated errno value. + If the constructor fails, it will set $IO::Socket::errstr and $@ to an + appropriate error message; this may be from $! or it may be some other + string; not every failure necessarily has an associated errno value. new (one arg) @@ -406,28 +406,28 @@ This can be achieved by using Net::LibAsyncNS, or the getaddrinfo(3) function can be called in a child process. - use IO::Socket::IP; - use Errno qw( EINPROGRESS EWOULDBLOCK ); + use IO::Socket::IP; + use Errno qw( EINPROGRESS EWOULDBLOCK ); - my @peeraddrinfo = ... # Caller must obtain the getaddinfo result here + my @peeraddrinfo = ... # Caller must obtain the getaddinfo result here - my $socket = IO::Socket::IP->new( - PeerAddrInfo => \@peeraddrinfo, - Blocking => 0, - ) or die "Cannot construct socket - $@"; + my $socket = IO::Socket::IP->new( + PeerAddrInfo => \@peeraddrinfo, + Blocking => 0, + ) or die "Cannot construct socket - $@"; - while( !$socket->connect and ( $! == EINPROGRESS || $! == EWOULDBLOCK ) ) { - my $wvec = ''; - vec( $wvec, fileno $socket, 1 ) = 1; - my $evec = ''; - vec( $evec, fileno $socket, 1 ) = 1; + while( !$socket->connect and ( $! == EINPROGRESS || $! == EWOULDBLOCK ) ) { + my $wvec = ''; + vec( $wvec, fileno $socket, 1 ) = 1; + my $evec = ''; + vec( $evec, fileno $socket, 1 ) = 1; - select( undef, $wvec, $evec, undef ) or die "Cannot select - $!"; - } + select( undef, $wvec, $evec, undef ) or die "Cannot select - $!"; + } - die "Cannot connect - $!" if $!; + die "Cannot connect - $!" if $!; - ... + ... The example above uses select(), but any similar mechanism should work analogously. IO::Socket::IP takes care when creating new socket @@ -450,9 +450,9 @@ The value of the ...Host argument will be split to give both the hostname and port (or service name): - hostname.example.org:http # Host name - 192.0.2.1:80 # IPv4 address - 2001:db8::1:80 # IPv6 address + hostname.example.org:http # Host name + 192.0.2.1:80 # IPv4 address + 2001:db8::1:80 # IPv6 address In each case, the port or service name (e.g. 80) is passed as the LocalService or PeerService argument. @@ -461,7 +461,7 @@ be either a service name, a decimal number, or a string containing both a service name and number, in a form such as - http(80) + http(80) In this case, the name (http) will be tried first, but if the resolver does not understand it then the port number (80) will be used instead. @@ -479,17 +479,17 @@ description if it could be parsed, or the given address and undef if it was not recognised. - IO::Socket::IP->split_addr( "hostname:http" ) - # ( "hostname", "http" ) + IO::Socket::IP->split_addr( "hostname:http" ) + # ( "hostname", "http" ) - IO::Socket::IP->split_addr( "192.0.2.1:80" ) - # ( "192.0.2.1", "80" ) + IO::Socket::IP->split_addr( "192.0.2.1:80" ) + # ( "192.0.2.1", "80" ) - IO::Socket::IP->split_addr( "2001:db8::1:80" ) - # ( "2001:db8::1", "80" ) + IO::Socket::IP->split_addr( "2001:db8::1:80" ) + # ( "2001:db8::1", "80" ) - IO::Socket::IP->split_addr( "something.else" ) - # ( "something.else", undef ) + IO::Socket::IP->split_addr( "something.else" ) + # ( "something.else", undef )
View file
_service:tar_scm:IO-Socket-IP-0.41.tar.gz/examples/connect.pl -> _service:tar_scm:IO-Socket-IP-0.42.tar.gz/examples/connect.pl
Changed
@@ -1,6 +1,6 @@ #!/usr/bin/perl -use strict; +use v5.14; use warnings; use IO::Poll; @@ -20,7 +20,7 @@ PeerService => $service, Type => SOCK_STREAM, Timeout => $TIMEOUT, -) or die "Cannot connect to $host:$service - $@"; +) or die "Cannot connect to $host:$service - $IO::Socket::errstr"; printf STDERR "Connected to %s:%s\n", $socket->peerhost_service;
View file
_service:tar_scm:IO-Socket-IP-0.41.tar.gz/examples/nonblocking_libasyncns.pl -> _service:tar_scm:IO-Socket-IP-0.42.tar.gz/examples/nonblocking_libasyncns.pl
Changed
@@ -1,6 +1,6 @@ #!/usr/bin/perl -use strict; +use v5.14; use warnings; use Errno qw( EINPROGRESS ); @@ -37,7 +37,7 @@ my $socket = IO::Socket::IP->new( PeerAddrInfo => \@peeraddrinfo, Blocking => 0, -) or die "Cannot construct socket - $@"; +) or die "Cannot construct socket - $IO::Socket::errstr"; $poll->mask( $socket => POLLOUT );
View file
_service:tar_scm:IO-Socket-IP-0.41.tar.gz/lib/IO/Socket/IP.pm -> _service:tar_scm:IO-Socket-IP-0.42.tar.gz/lib/IO/Socket/IP.pm
Changed
@@ -1,20 +1,13 @@ # You may distribute under the terms of either the GNU General Public License # or the Artistic License (the same terms as Perl itself) # -# (C) Paul Evans, 2010-2020 -- leonerd@leonerd.org.uk +# (C) Paul Evans, 2010-2023 -- leonerd@leonerd.org.uk -package IO::Socket::IP; +package IO::Socket::IP 0.42; -use v5; -use strict; +use v5.14; use warnings; -# $VERSION needs to be set before use base 'IO::Socket' -# - https://rt.cpan.org/Ticket/Display.html?id=92107 -BEGIN { - our $VERSION = '0.41'; -} - use base qw( IO::Socket ); use Carp; @@ -71,19 +64,19 @@ =head1 SYNOPSIS - use IO::Socket::IP; + use IO::Socket::IP; - my $sock = IO::Socket::IP->new( - PeerHost => "www.google.com", - PeerPort => "http", - Type => SOCK_STREAM, - ) or die "Cannot construct socket - $@"; + my $sock = IO::Socket::IP->new( + PeerHost => "www.google.com", + PeerPort => "http", + Type => SOCK_STREAM, + ) or die "Cannot construct socket - $IO::Socket::errstr"; - my $familyname = ( $sock->sockdomain == PF_INET6 ) ? "IPv6" : - ( $sock->sockdomain == PF_INET ) ? "IPv4" : - "unknown"; + my $familyname = ( $sock->sockdomain == PF_INET6 ) ? "IPv6" : + ( $sock->sockdomain == PF_INET ) ? "IPv4" : + "unknown"; - printf "Connected to google via %s\n", $familyname; + printf "Connected to google via %s\n", $familyname; =head1 DESCRIPTION @@ -108,15 +101,15 @@ C<IO::Socket> constructor with either C<PF_INET> or C<PF_INET6> as the C<Domain> parameter will yield an C<IO::Socket::IP> object. - use IO::Socket::IP -register; + use IO::Socket::IP -register; - my $sock = IO::Socket->new( - Domain => PF_INET6, - LocalHost => "::1", - Listen => 1, - ) or die "Cannot create socket - $@\n"; + my $sock = IO::Socket->new( + Domain => PF_INET6, + LocalHost => "::1", + Listen => 1, + ) or die "Cannot create socket - $IO::Socket::errstr\n"; - print "Created a socket of type " . ref($sock) . "\n"; + print "Created a socket of type " . ref($sock) . "\n"; Note that C<-register> is a global setting that applies to the entire program; it cannot be applied only for certain callers, removed, or limited by lexical @@ -154,6 +147,12 @@ die "Cannot socket(PF_INET6) - $!"; if( setsockopt $testsock, IPPROTO_IPV6, IPV6_V6ONLY, 0 ) { + if( $^O eq "dragonfly") { + # dragonflybsd 6.4 lies about successfully turning this off + if( getsockopt $testsock, IPPROTO_IPV6, IPV6_V6ONLY ) { + return $can_disable_v6only = 0; + } + } return $can_disable_v6only = 1; } elsif( $! == EINVAL || $! == EOPNOTSUPP ) { @@ -280,10 +279,10 @@ For example, both options given below are equivalent to setting C<ReuseAddr>. - Sockopts => - SOL_SOCKET, SO_REUSEADDR , - SOL_SOCKET, SO_REUSEADDR, pack( "i", 1 ) , - + Sockopts => + SOL_SOCKET, SO_REUSEADDR , + SOL_SOCKET, SO_REUSEADDR, pack( "i", 1 ) , + =item V6Only => BOOL @@ -300,12 +299,12 @@ OpenBSD and MirBSD, will fail with C<EINVAL> if you attempt to disable it. To determine whether it is possible to disable, you may use the class method - if( IO::Socket::IP->CAN_DISABLE_V6ONLY ) { - ... - } - else { - ... - } + if( IO::Socket::IP->CAN_DISABLE_V6ONLY ) { + ... + } + else { + ... + } If your platform does not support disabling this option but you still want to listen for both C<AF_INET> and C<AF_INET6> connections you will have to create @@ -336,9 +335,9 @@ operation as a whole. Further note that the timeout does not apply to the initial hostname resolve operation, if connecting by hostname. -This behviour is copied inspired by C<IO::Socket::INET>; for more fine grained -control over connection timeouts, consider performing a nonblocking connect -directly. +This behaviour is copied inspired by C<IO::Socket::INET>; for more fine +grained control over connection timeouts, consider performing a nonblocking +connect directly. =back @@ -353,9 +352,9 @@ the C<AI_ADDRCONFIG> flag, no host name, and a service name of C<"0">, and uses the family of the first returned result. -If the constructor fails, it will set C<$@> to an appropriate error message; -this may be from C<$!> or it may be some other string; not every failure -necessarily has an associated C<errno> value. +If the constructor fails, it will set C<$IO::Socket::errstr> and C<$@> to +an appropriate error message; this may be from C<$!> or it may be some other +string; not every failure necessarily has an associated C<errno> value. =head2 new (one arg) @@ -493,7 +492,7 @@ } if( $err ) { - $@ = "$err"; + $IO::Socket::errstr = $@ = "$err"; $! = EINVAL; return; } @@ -520,7 +519,7 @@ } if( $err ) { - $@ = "$err"; + $IO::Socket::errstr = $@ = "$err"; $! = EINVAL; return; } @@ -598,7 +597,7 @@ else { ( my $err, @infos ) = getaddrinfo( "", "0", \%hints ); if( $err ) { - $@ = "$err"; + $IO::Socket::errstr = $@ = "$err"; $! = EINVAL; return; } @@ -647,12 +646,14 @@ foreach my $sockopt ( @{ ${*$self}{io_socket_ip_sockopts} } ) { my ( $level, $optname, $value ) = @$sockopt; - $self->setsockopt( $level, $optname, $value ) or ( $@ = "$!", return undef ); + $self->setsockopt( $level, $optname, $value ) or + ( $IO::Socket::errstr = $@ = "$!", return undef ); } if( defined ${*$self}{io_socket_ip_v6only} and defined $AF_INET6 and $info->{family} == $AF_INET6 ) { my $v6only = ${*$self}{io_socket_ip_v6only}; - $self->setsockopt( IPPROTO_IPV6, IPV6_V6ONLY, pack "i", $v6only ) or ( $@ = "$!", return undef ); + $self->setsockopt( IPPROTO_IPV6, IPV6_V6ONLY, pack "i", $v6only ) or + ( $IO::Socket::errstr = $@ = "$!", return undef ); } if( defined( my $addr = $info->{localaddr} ) ) { @@ -661,7 +662,8 @@ } if( defined( my $listenqueue = ${*$self}{io_socket_ip_listenqueue} ) ) { - $self->listen( $listenqueue ) or ( $@ = "$!", return undef ); + $self->listen( $listenqueue ) or
View file
_service:tar_scm:IO-Socket-IP-0.41.tar.gz/t/00use.t -> _service:tar_scm:IO-Socket-IP-0.42.tar.gz/t/00use.t
Changed
@@ -1,7 +1,6 @@ #!/usr/bin/perl -use v5; -use strict; +use v5.14; use warnings; use Test::More;
View file
_service:tar_scm:IO-Socket-IP-0.41.tar.gz/t/01local-client-v4.t -> _service:tar_scm:IO-Socket-IP-0.42.tar.gz/t/01local-client-v4.t
Changed
@@ -1,7 +1,6 @@ #!/usr/bin/perl -use v5; -use strict; +use v5.14; use warnings; use Test::More; @@ -30,7 +29,7 @@ LocalHost => "127.0.0.1", Type => Socket->$socktype, Proto => ( $socktype eq "SOCK_STREAM" ? "tcp" : "udp" ), # Because IO::Socket::INET is stupid and always presumes tcp - ) or die "Cannot listen on PF_INET - $@"; + ) or die "Cannot listen on PF_INET - $IO::Socket::errstr"; my $socket = IO::Socket::IP->new( PeerHost => "127.0.0.1", @@ -39,7 +38,7 @@ ); ok( defined $socket, "IO::Socket::IP->new constructs a $socktype socket" ) or - diag( " error was $@" ); + diag( " error was $IO::Socket::errstr" ); is( $socket->sockdomain, AF_INET, "\$socket->sockdomain for $socktype" ); is( $socket->socktype, Socket->$socktype, "\$socket->socktype for $socktype" );
View file
_service:tar_scm:IO-Socket-IP-0.41.tar.gz/t/02local-server-v4.t -> _service:tar_scm:IO-Socket-IP-0.42.tar.gz/t/02local-server-v4.t
Changed
@@ -1,7 +1,6 @@ #!/usr/bin/perl -use v5; -use strict; +use v5.14; use warnings; use Test::More; @@ -33,7 +32,7 @@ ); ok( defined $testserver, "IO::Socket::IP->new constructs a $socktype socket" ) or - diag( " error was $@" ); + diag( " error was $IO::Socket::errstr" ); is( $testserver->sockdomain, AF_INET, "\$testserver->sockdomain for $socktype" ); is( $testserver->socktype, Socket->$socktype, "\$testserver->socktype for $socktype" ); @@ -53,7 +52,7 @@ PeerPort => $testserver->sockport, Type => Socket->$socktype, Proto => ( $socktype eq "SOCK_STREAM" ? "tcp" : "udp" ), # Because IO::Socket::INET is stupid and always presumes tcp - ) or die "Cannot connect to PF_INET - $@"; + ) or die "Cannot connect to PF_INET - $IO::Socket::errstr"; my $testclient = ( $socktype eq "SOCK_STREAM" ) ? $testserver->accept :
View file
_service:tar_scm:IO-Socket-IP-0.41.tar.gz/t/03local-cross-v4.t -> _service:tar_scm:IO-Socket-IP-0.42.tar.gz/t/03local-cross-v4.t
Changed
@@ -1,7 +1,6 @@ #!/usr/bin/perl -use v5; -use strict; +use v5.14; use warnings; use Test::More; @@ -14,13 +13,13 @@ LocalHost => "127.0.0.1", LocalPort => "0", Type => Socket->$socktype, - ) or die "Cannot listen on PF_INET - $@"; + ) or die "Cannot listen on PF_INET - $IO::Socket::errstr"; my $socket = IO::Socket::IP->new( PeerHost => "127.0.0.1", PeerService => $testserver->sockport, Type => Socket->$socktype, - ) or die "Cannot connect on PF_INET - $@"; + ) or die "Cannot connect on PF_INET - $IO::Socket::errstr"; my $testclient = ( $socktype eq "SOCK_STREAM" ) ? $testserver->accept :
View file
_service:tar_scm:IO-Socket-IP-0.41.tar.gz/t/04local-client-v6.t -> _service:tar_scm:IO-Socket-IP-0.42.tar.gz/t/04local-client-v6.t
Changed
@@ -1,7 +1,6 @@ #!/usr/bin/perl -use v5; -use strict; +use v5.14; use warnings; use Test::More; @@ -54,7 +53,7 @@ ); ok( defined $socket, "IO::Socket::IP->new constructs a $socktype socket" ) or - diag( " error was $@" ); + diag( " error was $IO::Socket::errstr" ); is( $socket->sockdomain, $AF_INET6, "\$socket->sockdomain for $socktype" ); is( $socket->socktype, Socket->$socktype, "\$socket->socktype for $socktype" );
View file
_service:tar_scm:IO-Socket-IP-0.41.tar.gz/t/05local-server-v6.t -> _service:tar_scm:IO-Socket-IP-0.42.tar.gz/t/05local-server-v6.t
Changed
@@ -1,7 +1,6 @@ #!/usr/bin/perl -use v5; -use strict; +use v5.14; use warnings; use Test::More; @@ -40,7 +39,7 @@ ); ok( defined $testserver, "IO::Socket::IP->new constructs a $socktype socket" ) or - diag( " error was $@" ); + diag( " error was $IO::Socket::errstr" ); is( $testserver->sockdomain, $AF_INET6, "\$testserver->sockdomain for $socktype" ); is( $testserver->socktype, Socket->$socktype, "\$testserver->socktype for $socktype" );
View file
_service:tar_scm:IO-Socket-IP-0.41.tar.gz/t/06local-cross-v6.t -> _service:tar_scm:IO-Socket-IP-0.42.tar.gz/t/06local-cross-v6.t
Changed
@@ -1,7 +1,6 @@ #!/usr/bin/perl -use v5; -use strict; +use v5.14; use warnings; use Test::More; @@ -17,13 +16,13 @@ LocalHost => "::1", LocalPort => "0", Type => Socket->$socktype, - ) or die "Cannot listen on PF_INET6 - $@"; + ) or die "Cannot listen on PF_INET6 - $IO::Socket::errstr"; my $socket = IO::Socket::IP->new( PeerHost => "::1", PeerService => $testserver->sockport, Type => Socket->$socktype, - ) or die "Cannot connect on PF_INET6 - $@"; + ) or die "Cannot connect on PF_INET6 - $IO::Socket::errstr"; my $testclient = ( $socktype eq "SOCK_STREAM" ) ? $testserver->accept :
View file
_service:tar_scm:IO-Socket-IP-0.41.tar.gz/t/10args.t -> _service:tar_scm:IO-Socket-IP-0.42.tar.gz/t/10args.t
Changed
@@ -1,7 +1,6 @@ #!/usr/bin/perl -use v5; -use strict; +use v5.14; use warnings; use Test::More;
View file
_service:tar_scm:IO-Socket-IP-0.41.tar.gz/t/11sockopts.t -> _service:tar_scm:IO-Socket-IP-0.42.tar.gz/t/11sockopts.t
Changed
@@ -1,7 +1,6 @@ #!/usr/bin/perl -use v5; -use strict; +use v5.14; use warnings; use Test::More; @@ -22,7 +21,7 @@ Type => SOCK_STREAM, Listen => 1, ReuseAddr => 1, - ) or die "Cannot socket() - $@"; + ) or die "Cannot socket() - $IO::Socket::errstr"; ok( $sock->getsockopt( SOL_SOCKET, SO_REUSEADDR ), 'SO_REUSEADDR set' ); @@ -33,7 +32,7 @@ Sockopts => SOL_SOCKET, SO_REUSEADDR , , - ) or die "Cannot socket() - $@"; + ) or die "Cannot socket() - $IO::Socket::errstr"; ok( $sock->getsockopt( SOL_SOCKET, SO_REUSEADDR ), 'SO_REUSEADDR set via Sockopts' ); } @@ -51,7 +50,7 @@ Type => SOCK_STREAM, Listen => 1, ReusePort => 1, - ) or die "Cannot socket() - $@"; + ) or die "Cannot socket() - $IO::Socket::errstr"; ok( $sock->getsockopt( SOL_SOCKET, SO_REUSEPORT ), 'SO_REUSEPORT set' ); } @@ -65,7 +64,7 @@ Broadcast => 1, ); skip "Privileges required to set broadcast on datagram socket", 1 if !$sock and $! == EACCES; - die "Cannot socket() - $@" unless $sock; + die "Cannot socket() - $IO::Socket::errstr" unless $sock; ok( $sock->getsockopt( SOL_SOCKET, SO_BROADCAST ), 'SO_BROADCAST set' ); }
View file
_service:tar_scm:IO-Socket-IP-0.41.tar.gz/t/12port-fallback.t -> _service:tar_scm:IO-Socket-IP-0.42.tar.gz/t/12port-fallback.t
Changed
@@ -1,7 +1,6 @@ #!/usr/bin/perl -use v5; -use strict; +use v5.14; use warnings; use Test::More;
View file
_service:tar_scm:IO-Socket-IP-0.41.tar.gz/t/13addrinfo.t -> _service:tar_scm:IO-Socket-IP-0.42.tar.gz/t/13addrinfo.t
Changed
@@ -1,7 +1,6 @@ #!/usr/bin/perl -use v5; -use strict; +use v5.14; use warnings; use Test::More; @@ -16,7 +15,7 @@ Listen => 1, LocalHost => "127.0.0.1", Type => SOCK_STREAM, - ) or die "Cannot listen on PF_INET - $@"; + ) or die "Cannot listen on PF_INET - $IO::Socket::errstr"; my ( $err, @peeraddrinfo ) = getaddrinfo( "127.0.0.1", $testserver->sockport, { socktype => SOCK_STREAM } ); $err and die "Cannot getaddrinfo 127.0.0.1 - $err"; @@ -26,7 +25,7 @@ ); ok( defined $socket, 'IO::Socket::IP->new( PeerAddrInfo => ... ) constructs a new socket' ) or - diag( " error was $@" ); + diag( " error was $IO::Socket::errstr" ); is_deeply( unpack_sockaddr_in $socket->peername , unpack_sockaddr_in $testserver->sockname , @@ -43,12 +42,12 @@ ); ok( defined $socket, 'IO::Socket::IP->new( LocalAddrInfo => ... ) constructs a new socket' ) or - diag( " error was $@" ); + diag( " error was $IO::Socket::errstr" ); my $testclient = IO::Socket::INET->new( PeerHost => "127.0.0.1", PeerPort => $socket->sockport, - ) or die "Cannot connect to localhost - $@"; + ) or die "Cannot connect to localhost - $IO::Socket::errstr"; is_deeply( unpack_sockaddr_in $socket->sockname , unpack_sockaddr_in $testclient->peername ,
View file
_service:tar_scm:IO-Socket-IP-0.41.tar.gz/t/14fileno.t -> _service:tar_scm:IO-Socket-IP-0.42.tar.gz/t/14fileno.t
Changed
@@ -1,7 +1,6 @@ #!/usr/bin/perl -use v5; -use strict; +use v5.14; use warnings; use Test::More; @@ -11,7 +10,7 @@ socket( my $tmph, AF_INET, SOCK_STREAM, 0 ) or die "Cannot socket() - $!"; -my $socket = IO::Socket::IP->new or die "Cannot create IO::Socket::IP - $@"; +my $socket = IO::Socket::IP->new or die "Cannot create IO::Socket::IP - $IO::Socket::errstr"; $socket->socket( AF_INET, SOCK_STREAM, 0 ) or die "Cannot socket() - $!"; my $fileno = $socket->fileno;
View file
_service:tar_scm:IO-Socket-IP-0.41.tar.gz/t/15io-socket.t -> _service:tar_scm:IO-Socket-IP-0.42.tar.gz/t/15io-socket.t
Changed
@@ -1,7 +1,6 @@ #!/usr/bin/perl -use v5; -use strict; +use v5.14; use warnings; use Test::More; @@ -20,7 +19,7 @@ ); isa_ok( $sock, "IO::Socket::IP", 'IO::Socket->new( Domain => AF_INET )' ) or - diag( " error was $@" ); + diag( " error was $IO::Socket::errstr" ); $sock = IO::Socket->new( Domain => AF_INET, @@ -47,7 +46,7 @@ ); isa_ok( $sock, "IO::Socket::IP", 'IO::Socket->new( Domain => AF_INET6 )' ) or - diag( " error was $@" ); + diag( " error was $IO::Socket::errstr" ); $sock = IO::Socket->new( Domain => $AF_INET6,
View file
_service:tar_scm:IO-Socket-IP-0.41.tar.gz/t/16v6only.t -> _service:tar_scm:IO-Socket-IP-0.42.tar.gz/t/16v6only.t
Changed
@@ -1,7 +1,6 @@ #!/usr/bin/perl -use v5; -use strict; +use v5.14; use warnings; use Test::More; @@ -31,7 +30,7 @@ Type => SOCK_STREAM, V6Only => 1, GetAddrInfoFlags => 0, # disable AI_ADDRCONFIG - ) or die "Cannot listen on PF_INET6 - $@"; + ) or die "Cannot listen on PF_INET6 - $IO::Socket::errstr"; is( $listensock->getsockopt( IPPROTO_IPV6, IPV6_V6ONLY ), 1, 'IPV6_V6ONLY is 1 on $listensock' ); @@ -42,7 +41,7 @@ Type => SOCK_STREAM, GetAddrInfoFlags => 0, # disable AI_ADDRCONFIG ); - my $err = "$@"; + my $err = "$IO::Socket::errstr"; ok( !defined $testsock, 'Unable to connect PF_INET socket to PF_INET6 socket with V6Only true' ); like( $err, qr/\Q$ECONNREFUSED_STR/, 'Socket creation fails with connection refused' ); @@ -60,7 +59,7 @@ Type => SOCK_STREAM, V6Only => 0, GetAddrInfoFlags => 0, # disable AI_ADDRCONFIG - ) or die "Cannot listen on PF_INET6 - $@"; + ) or die "Cannot listen on PF_INET6 - $IO::Socket::errstr"; is( $listensock->getsockopt( IPPROTO_IPV6, IPV6_V6ONLY ), 0, 'IPV6_V6ONLY is 0 on $listensock' ); @@ -71,7 +70,7 @@ Type => SOCK_STREAM, GetAddrInfoFlags => 0, # disable AI_ADDRCONFIG ); - my $err = "$@"; + my $err = "$IO::Socket::errstr"; ok( defined $testsock, 'Connected PF_INET socket to PF_INET6 socket with V6Only false' ) or diag( "IO::Socket::IP->new failed - $err" );
View file
_service:tar_scm:IO-Socket-IP-0.41.tar.gz/t/17gai-flags.t -> _service:tar_scm:IO-Socket-IP-0.42.tar.gz/t/17gai-flags.t
Changed
@@ -1,7 +1,6 @@ #!/usr/bin/perl -use v5; -use strict; +use v5.14; use warnings; use Test::More;
View file
_service:tar_scm:IO-Socket-IP-0.41.tar.gz/t/18fdopen.t -> _service:tar_scm:IO-Socket-IP-0.42.tar.gz/t/18fdopen.t
Changed
@@ -1,7 +1,6 @@ #!/usr/bin/perl -use v5; -use strict; +use v5.14; use warnings; use Test::More; @@ -13,7 +12,7 @@ LocalHost => "127.0.0.1", Type => SOCK_STREAM, Listen => 1, -) or die "Cannot listen on AF_INET - $@"; +) or die "Cannot listen on AF_INET - $IO::Socket::errstr"; my $s2 = IO::Socket::IP->new; $s2->fdopen( $s1->fileno, 'r' ) or die "Cannot fdopen - $!";
View file
_service:tar_scm:IO-Socket-IP-0.41.tar.gz/t/19no-addrs.t -> _service:tar_scm:IO-Socket-IP-0.42.tar.gz/t/19no-addrs.t
Changed
@@ -1,7 +1,6 @@ #!/usr/bin/perl -use v5; -use strict; +use v5.14; use warnings; use Test::More; @@ -14,7 +13,7 @@ { my $sock = IO::Socket::IP->new( Family => AF_INET ); - my $save_exc = $@; + my $save_exc = $IO::Socket::errstr; ok( defined $sock, 'Constructor yields handle for Family => AF_INET' ) or diag( "Exception was $save_exc" ); @@ -31,7 +30,7 @@ skip "Unable to bind to ::1", 4; my $sock = IO::Socket::IP->new( Family => $AF_INET6 ); - my $save_exc = $@; + my $save_exc = $IO::Socket::errstr; ok( defined $sock, 'Constructor yields handle for Family => AF_INET6' ) or diag( "Exception was $save_exc" ); @@ -44,7 +43,7 @@ # what family { my $sock = IO::Socket::IP->new( Type => SOCK_STREAM ); - my $save_exc = $@; + my $save_exc = $IO::Socket::errstr; ok( defined $sock, 'Constructor yields handle for Type => SOCK_STREAM' ) or diag( "Exception was $save_exc" );
View file
_service:tar_scm:IO-Socket-IP-0.41.tar.gz/t/20subclass.t -> _service:tar_scm:IO-Socket-IP-0.42.tar.gz/t/20subclass.t
Changed
@@ -1,23 +1,26 @@ #!/usr/bin/perl -use v5; -use strict; +use v5.14; use warnings; use Test::More; use IO::Socket::IP; +package MySubclass { + use base qw( IO::Socket::IP ); +} + my $server = IO::Socket::IP->new( Listen => 1, LocalHost => "127.0.0.1", LocalPort => 0, -) or die "Cannot listen on PF_INET - $!"; +) or die "Cannot listen on PF_INET - $IO::Socket::errstr"; my $client = IO::Socket::IP->new( PeerHost => $server->sockhost, PeerPort => $server->sockport, -) or die "Cannot connect on PF_INET - $!"; +) or die "Cannot connect on PF_INET - $IO::Socket::errstr"; my $accepted = $server->accept( 'MySubclass' ) or die "Cannot accept - $!"; @@ -25,6 +28,3 @@ isa_ok( $accepted, 'MySubclass' ); done_testing; - -package MySubclass; -use base qw( IO::Socket::IP );
View file
_service:tar_scm:IO-Socket-IP-0.41.tar.gz/t/21as-inet.t -> _service:tar_scm:IO-Socket-IP-0.42.tar.gz/t/21as-inet.t
Changed
@@ -1,7 +1,6 @@ #!/usr/bin/perl -use v5; -use strict; +use v5.14; use warnings; use Test::More; @@ -12,12 +11,12 @@ Listen => 1, LocalHost => "127.0.0.1", LocalPort => 0, -) or die "Cannot listen on PF_INET - $!"; +) or die "Cannot listen on PF_INET - $IO::Socket::errstr"; my $client = IO::Socket::IP->new( PeerHost => $server->sockhost, PeerPort => $server->sockport, -) or die "Cannot connect on PF_INET - $!"; +) or die "Cannot connect on PF_INET - $IO::Socket::errstr"; my $accepted = $server->accept or die "Cannot accept - $!";
View file
_service:tar_scm:IO-Socket-IP-0.41.tar.gz/t/22timeout.t -> _service:tar_scm:IO-Socket-IP-0.42.tar.gz/t/22timeout.t
Changed
@@ -1,7 +1,6 @@ #!/usr/bin/perl -use v5; -use strict; +use v5.14; use warnings; use Test::More; @@ -12,13 +11,13 @@ Listen => 1, LocalHost => "127.0.0.1", LocalPort => 0, -) or die "Cannot listen on PF_INET - $!"; +) or die "Cannot listen on PF_INET - $IO::Socket::errstr"; my $client = IO::Socket::IP->new( PeerHost => $server->sockhost, PeerPort => $server->sockport, Timeout => 0.1, -) or die "Cannot connect on PF_INET - $!"; +) or die "Cannot connect on PF_INET - $IO::Socket::errstr"; ok( defined $client, 'client constructed with Timeout' ); ok( $client->blocking, 'client is in blocking mode after connect' );
View file
_service:tar_scm:IO-Socket-IP-0.41.tar.gz/t/30nonblocking-connect.t -> _service:tar_scm:IO-Socket-IP-0.42.tar.gz/t/30nonblocking-connect.t
Changed
@@ -1,7 +1,6 @@ #!/usr/bin/perl -use v5; -use strict; +use v5.14; use warnings; use Test::More; @@ -28,7 +27,7 @@ Listen => 1, LocalHost => "127.0.0.1", Type => SOCK_STREAM, -) or die "Cannot listen on PF_INET - $@"; +) or die "Cannot listen on PF_INET - $IO::Socket::errstr"; my $socket = IO::Socket::IP->new( PeerHost => "127.0.0.1", @@ -38,7 +37,7 @@ ); ok( defined $socket, 'IO::Socket::IP->new( Blocking => 0 ) constructs a socket' ) or - diag( " error was $@" ); + diag( " error was $IO::Socket::errstr" ); ok( defined $socket->fileno, '$socket has a fileno immediately after construction' );
View file
_service:tar_scm:IO-Socket-IP-0.41.tar.gz/t/31nonblocking-connect-internet.t -> _service:tar_scm:IO-Socket-IP-0.42.tar.gz/t/31nonblocking-connect-internet.t
Changed
@@ -1,7 +1,6 @@ #!/usr/bin/perl -use v5; -use strict; +use v5.14; use warnings; use Test::More; @@ -32,7 +31,7 @@ ); ok( defined $socket, "defined \$socket for $test_host:$test_good_port" ) or - diag( " error was $@" ); + diag( " error was $IO::Socket::errstr" ); ok( defined $socket->fileno, '$socket has fileno' ); @@ -71,7 +70,7 @@ ); ok( defined $socket, "defined \$socket for $test_host:$test_bad_port" ) or - diag( " error was $@" ); + diag( " error was $IO::Socket::errstr" ); ok( defined $socket->fileno, '$socket has fileno' );
View file
_service:tar_scm:IO-Socket-IP-0.41.tar.gz/t/99pod.t -> _service:tar_scm:IO-Socket-IP-0.42.tar.gz/t/99pod.t
Changed
@@ -1,7 +1,6 @@ #!/usr/bin/perl -use v5; -use strict; +use v5.14; use warnings; use Test::More;
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2