From f10f0f13c43635f1e3587d6d6a5f36e91011d777 Mon Sep 17 00:00:00 2001 From: Adam Potolsky Date: Wed, 24 Jun 2015 16:31:47 -0700 Subject: [PATCH] retry case needs to do another job with the same parameters not just a new job #4750 --- src/lib/plugin/ns/SecureSocket.cpp | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/src/lib/plugin/ns/SecureSocket.cpp b/src/lib/plugin/ns/SecureSocket.cpp index 7533350d1..9f803f8c3 100644 --- a/src/lib/plugin/ns/SecureSocket.cpp +++ b/src/lib/plugin/ns/SecureSocket.cpp @@ -439,7 +439,7 @@ SecureSocket::checkResult(int status, int& retry) break; case SSL_ERROR_WANT_ACCEPT: - m_writable = true; + m_writable = true; m_readable = true; retry++; LOG((CLOG_DEBUG2 "want to accept, error=%d, attempt=%d", errorCode, retry)); @@ -611,7 +611,15 @@ SecureSocket::serviceConnect(ISocketMultiplexerJob* job, return NULL; } - return newJob(); + // If status > 0, success + if (status > 0) { + return newJob(); + } + + // Retry case + return new TSocketMultiplexerMethodJob( + this, &SecureSocket::serviceConnect, + getSocket(), isReadable(), isWritable()); } ISocketMultiplexerJob* @@ -626,13 +634,20 @@ 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, error happened if (status < 0) { return NULL; } - return newJob(); + // If status > 0, success + if (status > 0) { + return newJob(); + } + + // Retry case + return new TSocketMultiplexerMethodJob( + this, &SecureSocket::serviceConnect, + getSocket(), isReadable(), isWritable()); } void