diff --git a/src/lib/plugin/ns/SecureSocket.cpp b/src/lib/plugin/ns/SecureSocket.cpp index 94deca8a..7d7c9a83 100644 --- a/src/lib/plugin/ns/SecureSocket.cpp +++ b/src/lib/plugin/ns/SecureSocket.cpp @@ -378,8 +378,8 @@ SecureSocket::checkResult(int n, bool& fatal, int& retry) case SSL_ERROR_WANT_WRITE: case SSL_ERROR_WANT_CONNECT: case SSL_ERROR_WANT_ACCEPT: - LOG((CLOG_DEBUG2 "need to retry the same SSL function")); retry += 1; + LOG((CLOG_DEBUG2 "need to retry the same SSL function retry:%d", retry)); break; case SSL_ERROR_SYSCALL: @@ -413,6 +413,12 @@ SecureSocket::checkResult(int n, bool& fatal, int& retry) break; } + // If the retry max would exceed the allowed, treat it as a fatal error + if (retry > maxRetry()) { + LOG((CLOG_ERR "Maximum retry count exceeded:%d",retry)); + fatal = true; + } + if (fatal) { retry = 0; showError();