Revert old backoff code

This commit is contained in:
phl0 2018-10-22 22:59:09 +02:00
parent e46118c410
commit 784e8ce88e
No known key found for this signature in database
GPG key ID: 48EA1E640798CA9A

View file

@ -407,26 +407,16 @@ void CDAPNETGateway::sendMessages()
}
bool CDAPNETGateway::recover()
/*
Recovery now uses an increasing reconnect holdoff time to prevent
DoS-like reconnect attempts to the core server.
*/
{
const unsigned int backoff[] = {2000u, 4000u, 8000u, 10000u, 20000u, 60000u, 120000u, 240000u, 480000u, 600000u};
int i=0;
for (;;) {
m_dapnetNetwork->close();
CThread::sleep(backoff[i]);
bool ok = m_dapnetNetwork->open();
if (ok) {
ok = m_dapnetNetwork->login();
if (ok)
return true;
}
if (i < 9)
i++;
}
return false;