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
1 changed files with 7 additions and 1 deletions

View File

@ -378,8 +378,8 @@ SecureSocket::checkResult(int n, bool& fatal, int& retry)
case SSL_ERROR_WANT_WRITE: case SSL_ERROR_WANT_WRITE:
case SSL_ERROR_WANT_CONNECT: case SSL_ERROR_WANT_CONNECT:
case SSL_ERROR_WANT_ACCEPT: case SSL_ERROR_WANT_ACCEPT:
LOG((CLOG_DEBUG2 "need to retry the same SSL function"));
retry += 1; retry += 1;
LOG((CLOG_DEBUG2 "need to retry the same SSL function retry:%d", retry));
break; break;
case SSL_ERROR_SYSCALL: case SSL_ERROR_SYSCALL:
@ -413,6 +413,12 @@ SecureSocket::checkResult(int n, bool& fatal, int& retry)
break; 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) { if (fatal) {
retry = 0; retry = 0;
showError(); showError();