From: andrew deryabin Date: Sat, 21 Apr 2001 17:46:52 +0000 (+0400) Subject: IO::Socket::INET patch X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6f36ad4ab3b6497d1280576be438eea8cce4348e;p=p5sagit%2Fp5-mst-13.2.git IO::Socket::INET patch Message-ID: <20010421174652.B1426@technarchy> p4raw-id: //depot/perl@9779 --- diff --git a/ext/IO/lib/IO/Socket/INET.pm b/ext/IO/lib/IO/Socket/INET.pm index d2cc488..56dd7a2 100644 --- a/ext/IO/lib/IO/Socket/INET.pm +++ b/ext/IO/lib/IO/Socket/INET.pm @@ -84,7 +84,8 @@ sub _error { my $err = shift; { local($!); - $@ = join("",ref($sock),": ",@_); + my $title = ref($sock).": "; + $@ = join("", $_[0] =~ /^$title/ ? "" : $title, @_); close($sock) if(defined fileno($sock)); } @@ -189,12 +190,13 @@ sub configure { # my $timeout = ${*$sock}{'io_socket_timeout'}; # my $before = time() if $timeout; + undef $@; if ($sock->connect(pack_sockaddr_in($rport, $raddr))) { # ${*$sock}{'io_socket_timeout'} = $timeout; return $sock; } - return _error($sock, $!, "Timeout") + return _error($sock, $!, $@ || "Timeout") unless @raddr; # if ($timeout) {