Subject: | Win7SP1: t/public_suffix_ssl.t ............. 1/24 failed to connect |
Thanks for attempting to fix: https://rt.cpan.org/Ticket/Display.html?id=95881
I've successfully installed v1.989 and used the module on Linux, but the new update will not pass tests on Strawberry Perl 5.18.2.
cpanm -v IO::Socket::SSL
...
t/npn.t ........................... ok
t/public_suffix_lib_encode_idn.t .. ok
t/public_suffix_lib_libidn.t ...... ok
t/public_suffix_lib_uri.t ......... ok
t/public_suffix_ssl.t ............. 1/24 failed to connect: An operation was attempted on something that is not a socket. at t/public_suffix_ssl.t line 87.
# Looks like you planned 24 tests but ran 4.
# Looks like your test exited with 10038 just after 4.
Terminating on signal SIGINT(2)
Terminating on signal SIGINT(2)
CTerminating on signal SIGINT(2)
aught SIGINT. Trying to quit ...
dmake.exe: Error code 130, while making 'test_dynamic'
Terminate batch job (Y/N)? y
I attempted my own fix for the warnings bug, and changing line 223 to the following does the trick:
local $SIG{__DIE__} = sub {}; local $SIG{__WARN__} = sub {}; # be silent
my $ip6 = eval {
require Socket;
Socket->VERSION(1.95);
Socket->import( qw/inet_pton getnameinfo NI_NUMERICHOST NI_NUMERICSERV/ );
inet_pton( AF_INET6(),'::1') && AF_INET6();
} || eval {
require Socket6;
Socket6->import( qw/inet_pton getnameinfo NI_NUMERICHOST NI_NUMERICSERV/ );
inet_pton( AF_INET6(),'::1') && AF_INET6();
};
Can't say I love the idea of silencing warnings, but I have to assume that you were cool with that solution given you already had the localized SIGs.
I will continue to see if I can't come up with a better solution that actually eliminated the warnings entirely. The following change to line 229 -232 does remove 2 of the warnings:
} || eval {
use Socket6 qw/inet_pton getnameinfo NI_NUMERICHOST NI_NUMERICSERV/;
inet_pton( AF_INET6(),'::1') && AF_INET6();
};
But I have to assume that you used require and import for a reason. Also, while it removes the 4 original warnings, it introduces 2 additional ones related to the Socket->import(..)
Prototype mismatch: sub IO::Socket::SSL::NI_NUMERICHOST: none vs () at C:/strawberry/perl/lib/Exporter.pm line 66.
at C:/strawberry/perl/site/lib/IO/Socket/SSL.pm line 227.
Prototype mismatch: sub IO::Socket::SSL::NI_NUMERICSERV: none vs () at C:/strawberry/perl/lib/Exporter.pm line 66.
at C:/strawberry/perl/site/lib/IO/Socket/SSL.pm line 227.
If there's anything else I can do to help, please let me know. I'm happy to test any alternative solution that you come up with.
Regards,
- Miller