Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.95k stars 554 forks source link

[Win32] Define some Socket-related %Config keys #22676

Open sisyphus opened 5 days ago

sisyphus commented 5 days ago

Affects only mingw-w64 builds of perl. With mingw-w64, the Socket module that is built during the building of perl has lacked some features that are provided by a Socket module that is built and installed subsequent to the building of perl. This PR now gives us the fully featured Socket module when built as part of the perl build.

Fixes https://github.com/StrawberryPerl/Perl-Dist-Strawberry/issues/221 Also closes https://rt.cpan.org/Public/Bug/Display.html?id=149072


sisyphus commented 1 day ago

For your convenience, a little script based on the scripts provided by @Yaribz when reporting the issues to Strawberry Perl:

use strict;
use warnings;

use Socket qw'getaddrinfo AF_INET6';

my ($err)=getaddrinfo('perl.org', 80, {socktype => -1});
if($err) {print "1: getaddrinfo 'OK'\n" }
else {print "1: getaddrinfo 'NOT ok'\n" }

($err)=getaddrinfo('www.google.com', 443, {family => AF_INET6});
if($err) {print "2: getaddrinfo 'NOT ok'\n"}
else {print "2: getaddrinfo 'OK'\n"}

If perl is built with the patches provided here, that script outputs:

1: getaddrinfo 'OK'
2: getaddrinfo 'OK'

Else it outputs:

1: getaddrinfo 'NOT ok'
2: getaddrinfo 'NOT ok'

Admittedly, I suspect that little script does not demonstrate the full range of benefits that the patch provides.