mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1055316 - Fix unix socket connect backoff scheme such that it will actually backoff. r=tzimmermann
This commit is contained in:
parent
db8f872063
commit
b72e1de49b
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user