Work-around for proxy->s_server retry logic
authorViktor Dukhovni <openssl-users@dukhovni.org>
Sat, 20 Feb 2016 23:17:28 +0000 (18:17 -0500)
committerViktor Dukhovni <openssl-users@dukhovni.org>
Sat, 20 Feb 2016 23:26:23 +0000 (18:26 -0500)
Reviewed-by: Richard Levitte <levitte@openssl.org>
util/TLSProxy/Proxy.pm

index 7d21f4e83d6e46311bcef1b5572b1a639b4ce753..96e368189ef34f89a13078edf5abf75b39f89bf7 100644 (file)
@@ -269,7 +269,9 @@ sub clientstart
         );
 
         $retry--;
-        if (!$server_sock) {
+        if ($@ || !defined($server_sock)) {
+            $server_sock->close() if defined($server_sock);
+            undef $server_sock;
             if ($retry) {
                 #Sleep for a short while
                 select(undef, undef, undef, 0.1);