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
IO::Socket::INET failing for CNAME #12557
Comments
From shmuel+CPAN@patriot.netThere is a discussion of this problem in comp.lang.perl.misc starting Note Ben's comment "Looking about a bit, I found -- |
From @jkeenanOn Mon Nov 12 15:52:18 2012, shmuel+CPAN@patriot.net wrote:
That's a fairly long email thread. I suspect that most readers of this Would it be possible to summarize the problem and attach the patch directly? Thank you very much. |
The RT System itself - Status changed from 'new' to 'open' |
From shmuel+bitcard.org@patriot.netOn Mon Nov 12 16:15:29 2012, jkeenan wrote:
I've attached Ben Morrow's patch, which works under OS/2. Here's what I *Interesting*. I believe there's at least one bug here, in IO::Socket, First, the workaround: don't use Timeout. Find some other way of timing [You don't need to read the rest unless you're interested...] That ->new call gives me exactly the same result as you: EINVAL from Looking at the source of IO::Socket, the logic if Timeout is specified set non-blocking mode on the socket The EISCONN case is the strange one. There is a comment # Some systems refuse to re-connect() to and it turns out that it's not just Win32 that returns EINVAL in that - app calls connect(2) on a non-blocking socket The EISCONN/EINVAL error is saying 'this socket isn't fit to be reused': Looking about a bit, I found http://cr.yp.to/docs/connect.html, which [Oddly, it looks from the CVS log as though FreeBSD used to return -- |
From shmuel+bitcard.org@patriot.netSocket.pm.patchPath: border1.nntp.dca.giganews.com!novia!amsnews11.chello.com!xlned.com!feeder5.xlned.com!feed.xsnews.nl!border-1.ams.xsnews.nl!ecngs!feeder.ecngs.de!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!nntp.bt.com!news.bt.com.POSTED!not-for-mail
NNTP-Posting-Date: Wed, 07 Dec 2011 18:03:06 -0600
Newsgroups: comp.lang.perl.misc
Subject: Re: IO::Socket::INET hostname restrictions?
References: <4edae754$3$fuzhry+tra$mr2ice@news.patriot.net> <Nf-dnZw65uvr7kDTnZ2dnUVZ8tydnZ2d@bt.com> <4edf82d9$21$fuzhry+tra$mr2ice@news.patriot.net> <dfGdndQWk9hVEULTnZ2dnUVZ7rqdnZ2d@bt.com>
From: Ben Morrow <ben@morrow.me.uk>
Content-type: text/plain; charset=UTF-8
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: mauzo@anubis.morrow.me.uk (Ben Morrow)
Date: Wed, 7 Dec 2011 23:54:09 +0000
Message-ID: <1ua5r8-ac2.ln1@anubis.morrow.me.uk>
Lines: 42
X-Usenet-Provider: http://www.giganews.com
X-AuthenticatedUsername: NoAuthUser
X-Trace: sv3-6W3s8xwBWJ4+yCaM6dkp6rgox1m2lVg+sCrGOm/PkK43FvIOrD5BwGh8lI3mCq6PMcpgny6zD7AJ32x!vIziyMZB8hczj/6H1D1GvkShrARl6AOkp+K2QvbExwVXWfWqAZnlMTqxdrsOpBilsyksvkQ=
X-Complaints-To: abuse@btinternet.com
X-DMCA-Complaints-To: abuse@btinternet.com
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
Bytes: 3102
X-Original-Bytes: 2912
Xref: number.nntp.dca.giganews.com comp.lang.perl.misc:690120
Quoth Ben Morrow <ben@morrow.me.uk>:
>
> I do intend to report this as a bug in IO::Socket, when I get round to
> it.
If and when you get gcc working, would you be able to test this patch?
You would need to download and unpack the IO-1.25 tarball from CPAN,
apply the patch, and verify that it both passes 'make test' and gives a
more sensible error in the situation we've been discussing.
If you don't want to install the patched version you can use 'perl
-Mblib' from within the build directory to test the built-but-not-
installed modules. If you do want to install it, it should be perfectly
safe to install with 'make install': it will simply overwrite the IO::*
modules which came with your perl with newer versions.
Ben
diff -ur IO-1.25/lib/IO/Socket.pm IO/lib/IO/Socket.pm
--- IO-1.25/lib/IO/Socket.pm 2009-05-14 00:47:42.000000000 +0100
+++ IO/lib/IO/Socket.pm 2011-12-07 16:35:52.859688028 +0000
@@ -122,12 +122,12 @@
$err = $! || (exists &Errno::ETIMEDOUT ? &Errno::ETIMEDOUT : 1);
$@ = "connect: timeout";
}
- elsif (!connect($sock,$addr) &&
- not ($!{EISCONN} || ($! == 10022 && $^O eq 'MSWin32'))
- ) {
- # Some systems refuse to re-connect() to
- # an already open socket and set errno to EISCONN.
- # Windows sets errno to WSAEINVAL (10022)
+ elsif (!getpeername($sock)) {
+ if ($!{ENOTCONN}) {
+ # this read will fail, but will give us the error
+ # from connect(2) in $!
+ sysread $sock, my $tmp, 1;
+ }
$err = $!;
$@ = "connect: $!";
}
|
From Shmuel+gen@patriot.netIn <rt-3.6.HEAD-17500-1352765729-1406.115706-94-0@perl.org>, on
Done. Is it possible to reassign ownership to userid shmuel? Thanks. -- |
From @jkeenanOn Wed Nov 14 13:06:37 2012, Shmuel+gen@patriot.net wrote:
You are already listed as a Requestor on this ticket. That should suffice to give you (We don't seem to use "Owner" very much. Most tickets never acquire an "Owner". I HTH Thank you very much. |
Migrated from rt.perl.org#115706 (status was 'open')
Searchable as RT115706$
The text was updated successfully, but these errors were encountered: