Added code to test for and error out of max retry condition #4650

This commit is contained in:
Adam Potolsky 2015-05-20 14:27:25 -07:00
parent 1af9d58a9b
commit ad86041433

View File

@ -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();