Compare commits

..

2 Commits
rawhide ... f19

Author SHA1 Message Date
Petr Písař 6f804a3698 Fix multihomed SSL 2014-07-09 09:25:33 +02:00
Petr Písař 482c290696 0.30 bump 2014-07-07 13:43:11 +02:00
5 changed files with 82 additions and 220 deletions

10
.gitignore vendored
View File

@ -18,13 +18,3 @@
/IO-Socket-IP-0.28.tar.gz
/IO-Socket-IP-0.29.tar.gz
/IO-Socket-IP-0.30.tar.gz
/IO-Socket-IP-0.31.tar.gz
/IO-Socket-IP-0.32.tar.gz
/IO-Socket-IP-0.33.tar.gz
/IO-Socket-IP-0.34.tar.gz
/IO-Socket-IP-0.35.tar.gz
/IO-Socket-IP-0.36.tar.gz
/IO-Socket-IP-0.37.tar.gz
/IO-Socket-IP-0.38.tar.gz
/IO-Socket-IP-0.39.tar.gz
/IO-Socket-IP-0.41.tar.gz

View File

@ -0,0 +1,58 @@
Am Di 08. Jul 2014, 06:35:58, PEVANS schrieb:
> I may have to revert this one because it's causing bad knock-on
> effects with IO::Socket::SSL:
>
> https://rt.cpan.org/Ticket/Display.html?id=97050
>
> Basically: the very thing it was supposed to fix, it has broken. Meh.
Yes, unfortunately it wasn't as easy as I thought because the calling scheme inside IO::Socket::* (i.e. new -> configure -> connect ) isn't that simple if you have a class hierarchy and also try to implement multi-homing :(
But I think I have a working patch (included, against 0.30).
The basic idea of the patch is that one has to distinguish between an error at the transport layer which can be solved with IP based multi-homing and an error at the application layer. One could expect the system error to be reflected inside $!, while an application error will probably not set $! (e.g. IO::Socket::SSL sets an $SSL_ERROR variable). So if connect fails, but $! is not set, one can assume error at the application layer and stop trying to fix it with IP based multi-homing.
The other difference in the patch is to change $self->IO::Socket::IP::connect($addr) to CORE::connect($self,$addr), because if you have a look at the connect function it simple calls CORE::connect if an $addr argument is given. It was already right to not use $self->connect in this place, it was only a problem if called from inside the new - configure - connect chain.
With this patch the tests inside IO::Socket::IP pass and also the tests of IO::Socket::SSL.
Regards,
Steffen
<https://rt.cpan.org/Public/Bug/Display.html?id=95983>
diff --git a/lib/IO/Socket/IP.pm b/lib/IO/Socket/IP.pm
index 1911145..16eb7c8 100644
--- a/lib/IO/Socket/IP.pm
+++ b/lib/IO/Socket/IP.pm
@@ -601,7 +601,7 @@ sub setup
}
if( defined( my $addr = $info->{peeraddr} ) ) {
- if( $self->IO::Socket::IP::connect( $addr ) ) {
+ if( $self->connect( $addr ) ) {
$! = 0;
return 1;
}
@@ -611,6 +611,13 @@ sub setup
return 0;
}
+ # If connect failed but we have no system error there must be an error
+ # at the application layer, like a bad certificate with
+ # IO::Socket::SSL.
+ # In this case don't continue IP based multi-homing because the problem
+ # cannot be solved at the IP layer.
+ return 0 if ! $!;
+
${*$self}{io_socket_ip_errors}[0] = $!;
next;
}
@@ -651,7 +658,7 @@ sub connect
# (still in progress). This even works on MSWin32.
my $addr = ${*$self}{io_socket_ip_infos}[${*$self}{io_socket_ip_idx}]{peeraddr};
- if( $self->IO::Socket::IP::connect( $addr ) or $! == EISCONN ) {
+ if( CORE::connect( $self, $addr ) or $! == EISCONN ) {
delete ${*$self}{io_socket_ip_connect_in_progress};
$! = 0;
return 1;

View File

@ -1,26 +0,0 @@
use strict;
use warnings;
use ExtUtils::MakeMaker;
WriteMakefile(
'NAME' => 'IO::Socket::IP',
'VERSION_FROM' => 'lib/IO/Socket/IP.pm',
'ABSTRACT_FROM' => 'lib/IO/Socket/IP.pm',
'PREREQ_PM' => {
'base' => '0',
'Carp' => '0',
'constant' => '0',
'Errno' => '0',
'IO::Socket' => 0,
'POSIX' => '0',
'Socket' => '1.97',
'strict' => '0',
'warnings' => '0',
},
'TEST_REQUIRES' => {
'IO::Socket::INET' => '0',
'Test::More' => '0.88',
},
'INSTALLDIRS' => 'site',
);

View File

@ -1,227 +1,67 @@
# Run optional test
%if ! (0%{?rhel})
%bcond_without perl_IO_Socket_IP_enables_optional_test
%else
%bcond_with perl_IO_Socket_IP_enables_optional_test
%endif
Name: perl-IO-Socket-IP
Version: 0.41
Release: 490%{?dist}
Version: 0.30
Release: 2%{?dist}
Summary: Drop-in replacement for IO::Socket::INET supporting both IPv4 and IPv6
License: GPL+ or Artistic
URL: https://metacpan.org/release/IO-Socket-IP
Source0: https://cpan.metacpan.org/authors/id/P/PE/PEVANS/IO-Socket-IP-%{version}.tar.gz
# IO-Socket-IP-0.41 moved from ExtUtils::MakeMaker to Module::Build.
# It will make problems, because IO::Socket::IP is a dual-lived package and
# needs to be built very early on Perl bootstrap, but Module::Build is not
# a core package and thus not available in the early stage of bootstrapping.
# For this reason, we create Makefile.PL and use it instead of Build.PL.
Source1: Makefile.PL
Group: Development/Libraries
URL: http://search.cpan.org/dist/IO-Socket-IP/
Source0: http://www.cpan.org/authors/id/P/PE/PEVANS/IO-Socket-IP-%{version}.tar.gz
# Fix multihomed SSL, bug #1116600, CPAN RT#95983
Patch0: IO-Socket-IP-0.30-multihomed_SSL.patch
BuildArch: noarch
# Build
BuildRequires: coreutils
BuildRequires: make
BuildRequires: perl-generators
BuildRequires: perl-interpreter
BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76
# Runtime
BuildRequires: perl
BuildRequires: perl(base)
BuildRequires: perl(Carp)
BuildRequires: perl(constant)
BuildRequires: perl(Errno)
BuildRequires: perl(IO::Socket)
BuildRequires: perl(IO::Socket::INET)
BuildRequires: perl(Module::Build)
BuildRequires: perl(POSIX)
BuildRequires: perl(Socket) >= 1.97
BuildRequires: perl(strict)
buildrequires: perl(warnings)
# Tests only
BuildRequires: perl(IO::Socket::INET)
BuildRequires: perl(Test::More)
%if %{with perl_IO_Socket_IP_enables_optional_test} && !%{defined perl_bootstrap}
# Optional tests only
BuildRequires: perl(Socket6)
BuildRequires: perl(Test::Pod) >= 1.00
%endif
BuildRequires: perl(strict)
BuildRequires: perl(Test::More)
BuildRequires: perl(Test::Pod)
BuildRequires: perl(warnings)
Requires: perl(:MODULE_COMPAT_%(eval "$(perl -V:version)"; echo $version))
%{?perl_default_filter}
%description
This module provides a protocol-independent way to use IPv4 and IPv6
sockets, intended as a replacement for IO::Socket::INET. Most constructor
sockets, as a drop-in replacement for IO::Socket::INET. Most constructor
arguments and methods are provided in a backward-compatible way.
%prep
%setup -q -n IO-Socket-IP-%{version}
cp %{SOURCE1} .
chmod -x lib/IO/Socket/IP.pm
%patch0 -p1
%build
perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1
%{make_build}
perl Build.PL installdirs=vendor
./Build
%install
%{make_install}
./Build install destdir=%{buildroot} create_packlist=0
%{_fixperms} %{buildroot}/*
%check
make test
# Don't do the live test
rm -f t/21nonblocking-connect-internet.t
./Build test
%files
%license LICENSE
%doc Changes examples README
%doc Changes examples LICENSE README
%{perl_vendorlib}/*
%{_mandir}/man3/*
%changelog
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.41-490
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Fri Jun 03 2022 Jitka Plesnikova <jplesnik@redhat.com> - 0.41-489
- Perl 5.36 re-rebuild of bootstrapped packages
* Mon May 30 2022 Jitka Plesnikova <jplesnik@redhat.com> - 0.41-488
- Increase release to favour standalone package
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.41-480
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.41-479
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Mon May 24 2021 Jitka Plesnikova <jplesnik@redhat.com> - 0.41-478
- Perl 5.34 re-rebuild of bootstrapped packages
* Fri May 21 2021 Jitka Plesnikova <jplesnik@redhat.com> - 0.41-477
- Increase release to favour standalone package
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.41-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Thu Sep 17 2020 Jitka Plesnikova <jplesnik@redhat.com> - 0.41-2
- Create Makefile.PL, use ExtUtils::MakeMaker instead of Module::Build
* Wed Sep 16 2020 Jitka Plesnikova <jplesnik@redhat.com> - 0.41-1
- 0.41 bump
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.39-458
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Fri Jun 26 2020 Jitka Plesnikova <jplesnik@redhat.com> - 0.39-457
- Perl 5.32 re-rebuild of bootstrapped packages
* Mon Jun 22 2020 Jitka Plesnikova <jplesnik@redhat.com> - 0.39-456
- Increase release to favour standalone package
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.39-441
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.39-440
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Sun Jun 02 2019 Jitka Plesnikova <jplesnik@redhat.com> - 0.39-439
- Perl 5.30 re-rebuild of bootstrapped packages
* Thu May 30 2019 Jitka Plesnikova <jplesnik@redhat.com> - 0.39-438
- Increase release to favour standalone package
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.39-419
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.39-418
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Sat Jun 30 2018 Jitka Plesnikova <jplesnik@redhat.com> - 0.39-417
- Perl 5.28 re-rebuild of bootstrapped packages
* Wed Jun 27 2018 Jitka Plesnikova <jplesnik@redhat.com> - 0.39-416
- Increase release to favour standalone package
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.39-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.39-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Wed Jun 07 2017 Jitka Plesnikova <jplesnik@redhat.com> - 0.39-3
- Perl 5.26 re-rebuild of bootstrapped packages
* Sat Jun 03 2017 Jitka Plesnikova <jplesnik@redhat.com> - 0.39-2
- Perl 5.26 rebuild
* Tue Mar 07 2017 Jitka Plesnikova <jplesnik@redhat.com> - 0.39-1
- 0.39 bump
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.38-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Tue Aug 09 2016 Jitka Plesnikova <jplesnik@redhat.com> - 0.38-1
- 0.38 bump
* Tue Jul 12 2016 Petr Pisar <ppisar@redhat.com> - 0.37-367
- Migrate from Module::Build to ExtUtils::MakeMaker
- Correct IO/Socket/IP.pm file mode
* Wed May 18 2016 Jitka Plesnikova <jplesnik@redhat.com> - 0.37-366
- Perl 5.24 re-rebuild of bootstrapped packages
* Sat May 14 2016 Jitka Plesnikova <jplesnik@redhat.com> - 0.37-365
- Increase release to favour standalone package
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.37-348
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.37-347
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Wed Jun 10 2015 Jitka Plesnikova <jplesnik@redhat.com> - 0.37-346
- Perl 5.22 re-rebuild of bootstrapped packages
* Thu Jun 04 2015 Jitka Plesnikova <jplesnik@redhat.com> - 0.37-345
- Increase release to favour standalone package
* Thu Jun 04 2015 Jitka Plesnikova <jplesnik@redhat.com> - 0.37-2
- Perl 5.22 rebuild
* Fri Mar 13 2015 Petr Šabata <contyk@redhat.com> - 0.37-1
- 0.37 bump
* Fri Jan 30 2015 Petr Šabata <contyk@redhat.com> - 0.36-1
- 0.36 bump
- Win32 changes only
* Mon Jan 05 2015 Petr Šabata <contyk@redhat.com> - 0.35-1
- 0.35 bugfix bump
* Fri Dec 12 2014 Petr Pisar <ppisar@redhat.com> - 0.34-2
- Do not build-require non-core Socket6 module when bootstrapping this core
module
* Fri Dec 05 2014 Petr Šabata <contyk@redhat.com> - 0.34-1
- 0.34 bump, VMS bugfixes
* Tue Nov 25 2014 Petr Šabata <contyk@redhat.com> - 0.33-1
- 0.33 bump
* Thu Sep 18 2014 Petr Šabata <contyk@redhat.com> - 0.32-1
- 0.32 bump, implement connect timeout
* Wed Aug 27 2014 Jitka Plesnikova <jplesnik@redhat.com> - 0.31-2
- Perl 5.20 rebuild
* Wed Jul 16 2014 Petr Šabata <contyk@redhat.com> - 0.31-1
- 0.31 bump
* Wed Jul 09 2014 Petr Pisar <ppisar@redhat.com> - 0.30-2
- Fix multihomed SSL (bug #1116600)
* Mon Jul 07 2014 Petr Pisar <ppisar@redhat.com> - 0.30-1
- 0.30 bump
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.29-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Wed Feb 26 2014 Petr Šabata <contyk@redhat.com> - 0.29-1
- 0.29 bump

View File

@ -1 +1 @@
SHA512 (IO-Socket-IP-0.41.tar.gz) = f9fed6684ccaae3dcc1429d61211a24c2714af390b04a29e5a1362cfd470efc79305d3cb927d4caeb9e85302f248b2989e18332f8bef8022b427a49807f493fd
10d5d0eaafa5295a346d9dfcd69cbc1c IO-Socket-IP-0.30.tar.gz