From 2df88e07c4b21ba6361732e59400db16e8474302 Mon Sep 17 00:00:00 2001 From: Adam Potolsky Date: Wed, 24 Jun 2015 12:20:25 -0700 Subject: [PATCH] fixed retry logic for secure connect and accept #4750 --- src/lib/plugin/ns/SecureSocket.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/plugin/ns/SecureSocket.cpp b/src/lib/plugin/ns/SecureSocket.cpp index d18d53c7..7533350d 100644 --- a/src/lib/plugin/ns/SecureSocket.cpp +++ b/src/lib/plugin/ns/SecureSocket.cpp @@ -299,6 +299,7 @@ SecureSocket::secureAccept(int socket) LOG((CLOG_INFO "client connection may not be secure")); m_secureReady = false; ARCH->sleep(1); + retry = 0; return -1; // Failed, error out } @@ -342,6 +343,7 @@ SecureSocket::secureConnect(int socket) if (isFatal()) { LOG((CLOG_ERR "failed to connect secure socket")); + retry = 0; return -1; } @@ -352,6 +354,7 @@ SecureSocket::secureConnect(int socket) return 0; } + retry = 0; // No error, set ready, process and return ok m_secureReady = true; if (verifyCertFingerprint()) { @@ -623,7 +626,7 @@ SecureSocket::serviceAccept(ISocketMultiplexerJob* job, #elif SYSAPI_UNIX status = secureAccept(getSocket()->m_fd); #endif - + LOG((CLOG_ERR "DELME: status:%d",status)); // If status < 0, error happened if (status < 0) { return NULL;