Bug 1055316 - Fix unix socket connect backoff scheme such that it will actually backoff. r=tzimmermann

This commit is contained in:
Andrew Osmond 2014-08-18 15:53:00 -04:00
parent db8f872063
commit b72e1de49b

View File

@ -76,6 +76,7 @@ SocketConsumerBase::NotifyError()
mConnectionStatus = SOCKET_DISCONNECTED;
mConnectDelayMs = CalculateConnectDelayMs();
mConnectTimestamp = 0;
OnConnectError();
}
@ -86,6 +87,7 @@ SocketConsumerBase::NotifyDisconnect()
mConnectionStatus = SOCKET_DISCONNECTED;
mConnectDelayMs = CalculateConnectDelayMs();
mConnectTimestamp = 0;
OnDisconnect();
}
@ -96,7 +98,7 @@ SocketConsumerBase::CalculateConnectDelayMs() const
uint32_t connectDelayMs = mConnectDelayMs;
if ((PR_IntervalNow()-mConnectTimestamp) > connectDelayMs) {
if (mConnectTimestamp && (PR_IntervalNow()-mConnectTimestamp) > connectDelayMs) {
// reset delay if connection has been opened for a while, or...
connectDelayMs = 0;
} else if (!connectDelayMs) {