Skip Menu |

This queue is for tickets about the IO-Socket-INET6 CPAN distribution.

Report information
The Basics
Id: 55664
Status: resolved
Priority: 0/
Queue: IO-Socket-INET6

People
Owner: SHLOMIF [...] cpan.org
Requestors: Steffen_Ullrich [...] genua.de
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.57
Fixed in: (no value)



Subject: optimizing configure to stop useless DNS lookups
Hi, Like already reported in https://rt.cpan.org/Ticket/Display.html?id=54656 : OpenBSD does DNS lookups if one tries to getaddrino(ipv4_address,AF_INET6,..) This causes useless DNS lookups in a simple program like IO::Socket::INET6->new( '127.0.0.1:22' ) This behavior seems to be right according to the interpretation of the RFC by the famous stevens, see "UNIX Network Programming" Page 323 (you may find it with google book search). These useless DNS lookups are triggered by an IMHO suboptimal algorithm to find the right pair of local and remote addresses. I think it can be done much more efficient with a maximum of 2 getaddrinfo calls, and as an added bonus it doesn't do the useless DNS lookups anymore. Attached is a new version of IO::Socket::INET6. the only difference to version 2.57 is a rewrite of sub configure. All tests pass. I've classified the bug as important, because the useless DNS lookups really slow down the connections on OpenBSD.
Subject: INET6.pm

Message body is not shown because it is too large.

Applied in 2.58 which was uploaded to the CPAN. Thanks! Next time please submit a patch instead of the entire file.
Seems like this patch causes the attached script to die with the error: <<< Could not connect - Connection refused at break-io-socket-inet6.pl line 19. Show quoted text
>>>
It works fine with the previous version. Can you send a new patch to the svn repository at: http://svn.berlios.de/svnroot/repos/web-cpan/IO-Socket-INET6/trunk/modules/IO-Socket-INET6 fixing this problem? It breaks Mojolicious if IO-Socket-INET6 is installed. Regards, -- Shlomi Fish
Subject: break-io-socket-inet6.pl
#!/usr/bin/perl package IOLoop; use strict; use warnings; use IO::Socket::INET6; my $port = 3000; # Listen on UNIX domain socket my $listening_sock = IO::Socket::INET6->new( Listen => 1, LocalPort => $port, ) or die "Can't create listen socket: $!"; my $cs = IO::Socket::INET6->new( PeerAddr => "localhost", PeerPort => $port, ) or die "Could not connect - $!";
Subject: Re: [rt.cpan.org #55664] optimizing configure to stop useless DNS lookups
Date: Thu, 25 Mar 2010 08:07:53 +0100
To: Shlomi Fish via RT <bug-IO-Socket-INET6 [...] rt.cpan.org>
From: Steffen Ullrich <Steffen_Ullrich [...] genua.de>
Show quoted text
> > It works fine with the previous version. Can you send a new patch to the > svn repository at: > > http://svn.berlios.de/svnroot/repos/web-cpan/IO-Socket-INET6/trunk/modules/IO-Socket-INET6 >
I have no access to the repository. But attached is a patch against the version in the repository which fixes the problem. Tested with perl5.10.0 and perl5.8.9 Regards, Steffen

Message body is not shown because sender requested not to inline it.

On Thu Mar 25 03:08:26 2010, SULLR wrote: Show quoted text
> > > > It works fine with the previous version. Can you send a new patch to
> the > INET6/trunk/modules/IO-Socket-INET6
> >
> > I have no access to the repository. > But attached is a patch against the version in the repository which > fixes > the problem. > Tested with perl5.10.0 and perl5.8.9 >
Thanks! I included a reworked version of this patch in IO-Socket-INET6 which was just uploaded to PAUSE and should be available on CPAN soon. Regards, -- Shlomi Fish Show quoted text
> Regards, > Steffen >
Resolving as the issue was fixed.