New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get IO::Socket::IP into core for seamless v4/v6 support #12707
Comments
From @wolfsageCreated by wolfsage@gmail.comThere've been efforts to get IO::Socket::IP into the core distribution to Doing this would allow IPv4 and IPv6 support to be shipped with Perl. I believe that this is a good idea, and in #p5p we came up with the 1. Encourage people to switch to IO::Socket::IP now Perl Info
|
From @wolfsageI've done some preliminary setup and testing, but I need to do more I hope to get to more soon (tomorrow, this weekend). Cheers, -- Matthew Horsfall (alh) |
From [Unknown Contact. See original ticket]I've done some preliminary setup and testing, but I need to do more I hope to get to more soon (tomorrow, this weekend). Cheers, -- Matthew Horsfall (alh) |
@wolfsage - Status changed from 'new' to 'open' |
From @leonerdOn Wed, Jan 16, 2013 at 07:17:57PM -0800, Matthew Horsfall via RT wrote:
Hi there, Thanks for taking a start at this one. How is progress? What's working currently...? Is there anything that -- leonerd@leonerd.org.uk |
From @wolfsageOn Mon, Feb 4, 2013 at 7:27 AM, Paul LeoNerd Evans
Paul, I hadn't got much done on this, but as discussed earlier in chat, I've There are 3 tests that fail that may or may not be important (at least one Failed 3 tests out of 2252, 99.87% okay. The full test output is attached. If you'd like to download and hack on the branch to try to fix these, you git://github.com/wolfsage/perl-1.git Something like: git clone git://github.com/wolfsage/perl-1.git If you clone this through github, feel free to push patches with pull Thanks, And again, I apologize for taking so long to get back to this. -- Matthew Horsfall (alh) |
From @leonerdOn Mon, Feb 04, 2013 at 07:52:34PM -0500, Matthew Horsfall (alh) wrote:
Will take a look...
This unit test employs Unwarranted Chumminess With Code Under Test. ok 2 I can't see a way to change INET.pm to handle this case; the entire unit
Oops; this I expect is due to a lack of use IO::Socket::IP -register; And a lack of Family => AF_INET in the @_-passing case And that IO::Socket::IP didn't construct a new unbound, unconnected
Fails on the ->connected test, because of IO::Socket::IP's subtly Now fixed upstream in IO::Socket::IP. Find attached a combined patch with newer IO::Socket::IP and fixes to -- leonerd@leonerd.org.uk |
From @leonerd0002-Newer-IO-Socket-IP-minor-bugfixes-to-fake-INET.pm-wr.patchFrom 7974d32e0d5c18a40d55b34201a0a3c011d96ca8 Mon Sep 17 00:00:00 2001
From: "Paul \"LeoNerd\" Evans" <leonerd@leonerd.org.uk>
Date: Mon, 11 Mar 2013 23:14:00 +0000
Subject: [PATCH 2/2] Newer IO::Socket::IP; minor bugfixes to fake INET.pm
wrapper to make more of IO's unit tests pass
---
cpan/IO-Socket-IP/lib/IO/Socket/IP.pm | 15 ++++++++++++---
dist/IO/lib/IO/Socket/INET.pm | 3 ++-
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/cpan/IO-Socket-IP/lib/IO/Socket/IP.pm b/cpan/IO-Socket-IP/lib/IO/Socket/IP.pm
index c40bc67..26dc3de 100644
--- a/cpan/IO-Socket-IP/lib/IO/Socket/IP.pm
+++ b/cpan/IO-Socket-IP/lib/IO/Socket/IP.pm
@@ -1,7 +1,7 @@
# 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-2012 -- leonerd@leonerd.org.uk
+# (C) Paul Evans, 2010-2013 -- leonerd@leonerd.org.uk
package IO::Socket::IP;
@@ -9,7 +9,7 @@ use strict;
use warnings;
use base qw( IO::Socket );
-our $VERSION = '0.18';
+our $VERSION = '0.18_001';
use Carp;
@@ -512,6 +512,15 @@ sub _configure
}
}
+ if( !@infos and defined $hints{family} ) {
+ # If there was a Family hint then create a plain unbound, unconnected socket
+ @infos = ( {
+ family => $hints{family},
+ socktype => $hints{socktype},
+ protocol => $hints{protocol},
+ } );
+ }
+
# In the nonblocking case, caller will be calling ->setup multiple times.
# Store configuration in the object for the ->setup method
# Yes, these are messy. Sorry, I can't help that...
@@ -633,7 +642,7 @@ sub connected
my $self = shift;
return defined $self->fileno &&
!${*$self}{io_socket_ip_connect_in_progress} &&
- defined $self->peername;
+ defined getpeername( $self ); # ->peername caches, we need to detect disconnection
}
=head1 METHODS
diff --git a/dist/IO/lib/IO/Socket/INET.pm b/dist/IO/lib/IO/Socket/INET.pm
index 3c04b57..e98461d 100644
--- a/dist/IO/lib/IO/Socket/INET.pm
+++ b/dist/IO/lib/IO/Socket/INET.pm
@@ -1,5 +1,6 @@
package IO::Socket::INET;
+use IO::Socket::IP -register;
use base qw( IO::Socket::IP );
use Socket qw( PF_INET );
@@ -7,7 +8,7 @@ sub new
{
my $class = shift;
return $class->SUPER::new(Family => PF_INET, PeerAddr => shift) if @_ == 1;
- return $class->SUPER::new(@_);
+ return $class->SUPER::new(Family => PF_INET, @_);
}
1;
--
1.7.10.4
|
From @wolfsageAlright, I've updated https://github.com/wolfsage/perl-1/tree/rt-116433 I've removed multihomed.t since it's testing internal state of a module All tests pass on my system, though META.JSON and META.YAML aren't up to rjbs / porters - can we get this branch smoked now? What do I need to do? Thanks, -- Matthew Horsfall (alh) |
From @rjbs* Matthew Horsfall via RT <perlbug-followup@perl.org> [2013-04-05T15:39:33]
Here, the manifest test is broken, too. porting/manifest.t (Wstat: 0 Tests: 10765 Failed: 3) I fixed the two porting tests and pushed the branch to The result is not immediately useful to me: 1..26 There is a long pause between ok 11 and death. -- |
From @wolfsageOn Sat, Apr 6, 2013 at 10:59 AM, Ricardo Signes via RT <
I finally reproduced this and tracked it down. Here in io_sock.t line 172 on: # Then test UDP sockets The call to IO::Socket->new() is creating a handle and then blessing it to Currently discussing options with LeoNerd to get this moving along. -- Matthew Horsfall (alh) |
From @wolfsageWhoops, forgot cc... On Tue, Apr 23, 2013 at 12:34 PM, Matthew Horsfall (alh) <wolfsage@gmail.com
|
From @leonerdOn Tue, 23 Apr 2013 12:34:49 -0400
This I'm classing as a bug in use IO::Socket::IP -register; Because IO::Socket::new deletes the Domain argument, there is nothing -- leonerd@leonerd.org.uk |
From @wolfsage
LeoNerd pushed a dev branch to CPAN of IO::Socket::IP containing a fix for rjbs has pulled it into the smoke me branch and now we're waiting testing -- Matthew Horsfall (alh) |
From @leonerdOn Wed, 24 Apr 2013 12:25:41 -0400
FYI, that smoked OK so I've called it a real IO::Socket::IP 0.21 -- leonerd@leonerd.org.uk |
From @craigberryOn Wed, Apr 24, 2013 at 11:25 AM, Matthew Horsfall (alh) <wolfsage@gmail.com
I built this branch as of smoke-me/rjbs/io-socket-ip 2013-04-24.15:51:27 and got the following new test failures on VMS: cpan/IO-Socket-IP/t/11sockopts ................................ 11sockopts.t passes when run by itself outside of the test suite. The ones ok( !$socket->blocking, '$socket->blocking' ); Something internally is setting the blocking flag to on even though the $ perl blocking.pl where blocking.pl looks like: $ type blocking.pl use IO::Socket::IP; my $testserver = IO::Socket::INET->new( my $socket = IO::Socket::IP->new( print "Blocking? : " . ($socket->blocking ? 'yes' : 'no') . "\n"; The ones that end with "connect-internet" fail on the test that looks like: ok( !$socket->connected, '$socket not yet connected' ); and elsewhere as well, though the other failures may be fallout from the $ perl t/21nonblocking-connect-internet.t I believe everything that goes wrong does so somewhere |
From @wolfsageOn Thu, Apr 25, 2013 at 5:04 PM, Craig A. Berry <craig.a.berry@gmail.com>wrote:
Craig, Any chance I or LeoNerd could get access to one of the failing systems so Thanks, -- Matthew Horsfall (alh) |
From @craigberryOn Tue, Apr 30, 2013 at 9:30 AM, Matthew Horsfall (alh)
I'm not against the idea but it would take quite a bit of my time and yours I did more or less get to the bottom of the 11sockopts.t failure, which is DB<4> s If you put "setsockopt broadcast privilege" into your favorite search Side note: it seems wrong to me that IO::Socket::setsockopt does not check I will try to get to the nonblocking failures soonish. |
From @wolfsageOn Tue, Apr 30, 2013 at 8:24 PM, Craig Berry via RT <
Fair enough though now you've got me curious about VMS :)
If you have the time to do this that's great. Thanks a lot. -- Matthew Horsfall (alh) |
1 similar comment
From @wolfsageOn Tue, Apr 30, 2013 at 8:24 PM, Craig Berry via RT <
Fair enough though now you've got me curious about VMS :)
If you have the time to do this that's great. Thanks a lot. -- Matthew Horsfall (alh) |
From @leonerdOn Tue, 30 Apr 2013 19:23:44 -0500
Oh it's totally ancilliary; if this doesn't work on VMS it's quite I'm curious to know though - is this a new failure since 0.21, or has -- leonerd@leonerd.org.uk |
From @craigberryOn Wed, May 1, 2013 at 4:45 PM, Paul LeoNerd <leonerd@leonerd.org.uk> wrote:
The first hunk in the attached patch does that. It also has a second hunk, That gets all the IO::Socket::IP tests in the smoke-me/rjbs/io-socket-ip I'm sorry it took me so long to put together this trivial patch; things And the patch inline for human readability: Inline Patch--- cpan/IO-Socket-IP/t/11sockopts.t;-0 Wed Apr 24 10:51:26 2013
+++ cpan/IO-Socket-IP/t/11sockopts.t Fri May 3 15:50:14 2013
@@ -39,7 +39,9 @@ SKIP: {
ok( $sock->getsockopt( SOL_SOCKET, SO_REUSEPORT ), 'SO_REUSEPORT set' );
}
-{
+SKIP: {
+ skip "SO_BROADCAST requires elevated privileges on $^O", 1 if $^O eq
Inline Patch--- dist/IO/lib/IO/Socket.pm;-0 Wed Apr 24 10:51:26 2013
+++ dist/IO/lib/IO/Socket.pm Fri May 3 15:45:21 2013
@@ -167,7 +167,7 @@ sub blocking {
my $sock = shift;
return $sock->SUPER::blocking(@_)
- if $^O ne 'MSWin32';
+ if $^O ne 'MSWin32' && $^O ne 'VMS';
# Windows handles blocking differently
# |
From @craigberryio-socket-ip-vms.patch--- cpan/IO-Socket-IP/t/11sockopts.t;-0 Wed Apr 24 10:51:26 2013
+++ cpan/IO-Socket-IP/t/11sockopts.t Fri May 3 15:50:14 2013
@@ -39,7 +39,9 @@ SKIP: {
ok( $sock->getsockopt( SOL_SOCKET, SO_REUSEPORT ), 'SO_REUSEPORT set' );
}
-{
+SKIP: {
+ skip "SO_BROADCAST requires elevated privileges on $^O", 1 if $^O eq 'VMS';
+
my $sock = IO::Socket::IP->new(
LocalHost => "127.0.0.1",
Type => SOCK_DGRAM,
--- dist/IO/lib/IO/Socket.pm;-0 Wed Apr 24 10:51:26 2013
+++ dist/IO/lib/IO/Socket.pm Fri May 3 15:45:21 2013
@@ -167,7 +167,7 @@ sub blocking {
my $sock = shift;
return $sock->SUPER::blocking(@_)
- if $^O ne 'MSWin32';
+ if $^O ne 'MSWin32' && $^O ne 'VMS';
# Windows handles blocking differently
#
|
From @leonerdOn Fri, 3 May 2013 16:34:41 -0500
Excellent, that sounds good.
Oh that's quite alright - often it can take a while to gain the sudden
That sounds OK, but I wonder if we can provide a better detection
That sounds good. I mean, non-ideal, but perhaps unavoidable, and in -- leonerd@leonerd.org.uk |
From @rjbs* "Craig A. Berry" <craig.a.berry@gmail.com> [2013-05-03T17:34:41]
Great, thanks. -- |
From @craigberryOn Sun, May 5, 2013 at 2:45 PM, Ricardo Signes <perl.p5p@rjbs.manxome.org>wrote:
Thanks, it's in as d358b6c. |
From @wolfsageOn Sun, May 5, 2013 at 4:49 PM, Craig A. Berry <craig.a.berry@gmail.com>wrote:
Thanks a lot everyone. I think there's one failure left to look at on Darwin ( getaddrinfo() - service name not available for the specified socket type at But I notice that same failure is affecting some other oses on CpanTesters: There are some other failures at Thanks, -- Matthew Horsfall (alh) |
From @wolfsageOn Mon, May 6, 2013 at 12:59 PM, Matthew Horsfall (alh)
I haven't forgotten this. The plan is to figure out the failure on I should have some free time soon to play around and possibly figure out Cheers, -- Matthew Horsfall (alh) |
From @wolfsageOn Wed, Jun 19, 2013 at 3:40 PM, Matthew Horsfall (alh)
Soon came and went, and then I finally made the time. smoke-me/rjbs/io-socket-ip is running blead with IO::Socket::IP 0.22 Provided the looks good enough, we can finally move onto smoking the branch Thanks for your patience, -- Matthew Horsfall (alh) |
From michiel.beijen@gmail.comOn Thu, Aug 15, 2013 at 2:52 PM, Matthew Horsfall (alh)
|
From @wolfsageOn Mon, Sep 2, 2013 at 10:23 AM, Michiel Beijen <michiel.beijen@gmail.com>wrote:
I think so. None of the failures look related: http://perl.develop-help.com/?b=smoke-me%2Frjbs%2Fio-socket-ip I'd like to see it smoke across more OSes, but this is all we have so far. I think taking this to the next step now would be good. Ricardo? Thanks, -- Matthew Horsfall (alh) |
From @xdgAfter some discussion on IRC today about the current state of affairs, * The "drop in replacement for IO::Socket::INET" language in the docs * IO::Socket::IP (with revised language) will be added to blead ASAP * Separately, tests of the "drop in" assertion will continue outside This ensures that v5.20.0 will finally have full in-core support for IPv6. If the drop-in testing goes well enough, the "drop in" language in the -- |
From @rjbs* David Golden <xdg@xdg.me> [2014-01-08T13:05:19]
…with the (perhaps obvious) proviso that it would be removed before 5.20 if too -- |
From @nwc10On Thu, Jan 09, 2014 at 09:02:49AM -0500, Ricardo Signes wrote:
By using Acme::Overide::INET (thanks xdg, this makes things a lot easier)* https://rt.cpan.org/Public/Bug/Display.html?id=91982 In one case, we seem to be getting a silent constructor failure. Nicholas Clark * Not yet on CPAN, because the PAUSE hardware is very unhappy. See |
From @leonerdOn Thu, 9 Jan 2014 16:49:21 +0000
Having looked at them, they both fall into the category of "existing Hard to see what a sensible course of action is here. I'm not overly -- leonerd@leonerd.org.uk |
From @xdgOn Thu, Jan 9, 2014 at 11:49 AM, Nicholas Clark <nick@ccl4.org> wrote:
Available here for now: Once PAUSE is up, I'll ship it and blog about it. David -- |
From @xdgOn Thu, Jan 9, 2014 at 1:39 PM, Paul "LeoNerd" Evans
How about making such cases fatal? Then at least if someone tries to David -- |
From @leonerdOn Fri, 10 Jan 2014 11:00:48 -0500
Well, one of these can indeed do this (which is hinted at here However, the other bug relates more to what the caller does with the -- leonerd@leonerd.org.uk |
From @leonerdOn Thu, 9 Jan 2014 16:49:21 +0000
I believe both of these are now fixed. Patches in the bugs. Lacking a PAUSE still, you can find the current devel snapshot that http://home.leonerd.org.uk/local/IO-Socket-IP-0.24+bzr219.tar.gz Ifwhen PAUSE comes back (or some other suitable replacement appears) -- leonerd@leonerd.org.uk |
From @leonerdOn Sat, 11 Jan 2014 00:08:43 +0000
PAUSE appears to be up and running again: http://metacpan.org/release/PEVANS/IO-Socket-IP-0.25 -- leonerd@leonerd.org.uk |
From @wolfsageI'm finally going through the smoke run I did of blead with IO::Socket::IP drop-in replacement of IO::Socket::INET vs blead. IO::Socket::IP is at .26, both branches smoked are at: commit b373396 I'll keep adding issues as I find them so they have more time to be worked on. So far: Catalyst::Authentication::Credential::RemoteHTTP IO::Event IO::Socket::SSL -- Matthew Horsfall (alh) Lots of noise to go through (There are ton of modules that fail randomly due to Hash key order and timing issues....) -- Matthew Horsfall (alh) |
From [Unknown Contact. See original ticket]I'm finally going through the smoke run I did of blead with IO::Socket::IP drop-in replacement of IO::Socket::INET vs blead. IO::Socket::IP is at .26, both branches smoked are at: commit b373396 I'll keep adding issues as I find them so they have more time to be worked on. So far: Catalyst::Authentication::Credential::RemoteHTTP IO::Event IO::Socket::SSL -- Matthew Horsfall (alh) Lots of noise to go through (There are ton of modules that fail randomly due to Hash key order and timing issues....) -- Matthew Horsfall (alh) |
From @leonerdOn Wed, 19 Feb 2014 05:21:59 -0800
0.26? Latest on CPAN is 0.28 and that is mostly test fixes, though also [CHANGES]
Hmmm. I thought IO::Socket::SSL could optionally use IO::Socket::IP if -- leonerd@leonerd.org.uk |
From @wolfsagePerl 5.20.0 was released and contains IO::Socket::IP. I'm marking this ticket resolved, and will try to continue the work of getting it more tested (including the issues previously mentioned) for 5.22. -- Matthew Horsfall (alh) |
@wolfsage - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#116433 (status was 'resolved')
Searchable as RT116433$
The text was updated successfully, but these errors were encountered: