From c192154b7b5060196110d20f17b18135fa216641 Mon Sep 17 00:00:00 2001 From: Steve Hay Date: Mon, 15 Aug 2011 21:30:41 +0100 Subject: [PATCH] Fix tabbing and trailing whitespace from commit f1d35e3443 and bump IO::Socket version. --- dist/IO/lib/IO/Socket.pm | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/dist/IO/lib/IO/Socket.pm b/dist/IO/lib/IO/Socket.pm index 06e4e6c..ce493b5 100644 --- a/dist/IO/lib/IO/Socket.pm +++ b/dist/IO/lib/IO/Socket.pm @@ -23,7 +23,7 @@ require IO::Socket::UNIX if ($^O ne 'epoc' && $^O ne 'symbian'); @ISA = qw(IO::Handle); -$VERSION = "1.32"; +$VERSION = "1.33"; @EXPORT_OK = qw(sockatmark); @@ -118,21 +118,21 @@ sub connect { my $sel = new IO::Select $sock; undef $!; - my($r,$w,$e) = IO::Select::select(undef,$sel,$sel,$timeout); - if(@$e[0]) { - # Windows return from select after the timeout in case of - # WSAECONNREFUSED(10061) if exception set is not used. - # This behavior is different from Linux. - # Using the exception - # set we now emulate the behavior in Linux - # - Karthik Rajagopalan - $err = $sock->getsockopt(SOL_SOCKET,SO_ERROR); - $@ = "connect: $err"; - } - elsif(!@$w[0]) { - $err = $! || (exists &Errno::ETIMEDOUT ? &Errno::ETIMEDOUT : 1); - $@ = "connect: timeout"; - } + my($r,$w,$e) = IO::Select::select(undef,$sel,$sel,$timeout); + if(@$e[0]) { + # Windows return from select after the timeout in case of + # WSAECONNREFUSED(10061) if exception set is not used. + # This behavior is different from Linux. + # Using the exception + # set we now emulate the behavior in Linux + # - Karthik Rajagopalan + $err = $sock->getsockopt(SOL_SOCKET,SO_ERROR); + $@ = "connect: $err"; + } + elsif(!@$w[0]) { + $err = $! || (exists &Errno::ETIMEDOUT ? &Errno::ETIMEDOUT : 1); + $@ = "connect: timeout"; + } elsif (!connect($sock,$addr) && not ($!{EISCONN} || ($! == 10022 && $^O eq 'MSWin32')) ) { -- 2.7.4