Used static variable than define #4750
Conflicts: src/lib/plugin/ns/SecureSocket.cpp
This commit is contained in:
parent
44966ee17f
commit
0ddf544efb
|
@ -36,11 +36,9 @@
|
||||||
|
|
||||||
#define MAX_ERROR_SIZE 65535
|
#define MAX_ERROR_SIZE 65535
|
||||||
|
|
||||||
enum {
|
// g_retryDelay * g_maxRetry = 10s
|
||||||
// this limit seems extremely high, but mac client seem to generate around
|
static const int g_maxRetry = 1000;
|
||||||
// 50,000 errors before they establish a connection (wtf?)
|
static const float g_retryDelay = 0.01f;
|
||||||
kMaxRetryCount = 100000
|
|
||||||
};
|
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
kMsgSize = 128
|
kMsgSize = 128
|
||||||
|
@ -318,6 +316,7 @@ SecureSocket::secureAccept(int socket)
|
||||||
if (retry > 0) {
|
if (retry > 0) {
|
||||||
LOG((CLOG_DEBUG2 "retry accepting secure socket"));
|
LOG((CLOG_DEBUG2 "retry accepting secure socket"));
|
||||||
m_secureReady = false;
|
m_secureReady = false;
|
||||||
|
ARCH->sleep(g_retryDelay);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -351,6 +350,7 @@ SecureSocket::secureConnect(int socket)
|
||||||
if (retry > 0) {
|
if (retry > 0) {
|
||||||
LOG((CLOG_DEBUG2 "retry connect secure socket"));
|
LOG((CLOG_DEBUG2 "retry connect secure socket"));
|
||||||
m_secureReady = false;
|
m_secureReady = false;
|
||||||
|
ARCH->sleep(g_retryDelay);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -475,8 +475,8 @@ SecureSocket::checkResult(int status, int& retry)
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the retry max would exceed the allowed, treat it as a fatal error
|
// If the retry max would exceed the allowed, treat it as a fatal error
|
||||||
if (retry > maxRetry()) {
|
if (retry > g_maxRetry) {
|
||||||
LOG((CLOG_ERR "passive ssl error limit exceeded: %d", retry));
|
LOG((CLOG_DEBUG "retry exceeded %f sec", g_maxRetry * g_retryDelay));
|
||||||
isFatal(true);
|
isFatal(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue