Fix TLSProxy race by adding missing eval
authorViktor Dukhovni <openssl-users@dukhovni.org>
Wed, 11 May 2016 22:01:41 +0000 (18:01 -0400)
committerViktor Dukhovni <openssl-users@dukhovni.org>
Wed, 11 May 2016 22:43:07 +0000 (18:43 -0400)
Reviewed-by: Richard Levitte <levitte@openssl.org>
util/TLSProxy/Proxy.pm

index aafd902bca4ac112668dfa54c71ee0da22b7b24d..950fd9074923492936584ce48b32018e8a27d11e 100644 (file)
@@ -226,12 +226,14 @@ sub clientstart
     do {
         my $servaddr = $self->server_addr;
         $servaddr =~ s/[\[\]]//g; # Remove [ and ]
-        $server_sock = $IP_factory->(
-            PeerAddr => $servaddr,
-            PeerPort => $self->server_port,
-            MultiHomed => 1,
-            Proto => 'tcp'
-        );
+        eval {
+            $server_sock = $IP_factory->(
+                PeerAddr => $servaddr,
+                PeerPort => $self->server_port,
+                MultiHomed => 1,
+                Proto => 'tcp'
+            );
+        };
 
         $retry--;
         if ($@ || !defined($server_sock)) {