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 7d21f4e..96e3681 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);