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 aafd902..950fd90 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)) {