зеркало из https://github.com/mozilla/gecko-dev.git
Bug 888058 - SimplePush: catch ping exception. r=dougt
This commit is contained in:
Родитель
851bd9c42b
Коммит
b6cccf566f
|
@ -678,8 +678,15 @@ this.PushService = {
|
|||
else if (this._currentState == STATE_READY) {
|
||||
// Send a ping.
|
||||
// Bypass the queue; we don't want this to be kept pending.
|
||||
this._ws.sendMsg('{}');
|
||||
debug("Sent ping.");
|
||||
// Watch out for exception in case the socket has disconnected.
|
||||
// When this happens, we pretend the ping was sent and don't specially
|
||||
// handle the exception, as the lack of a pong will lead to the socket
|
||||
// being reset.
|
||||
try {
|
||||
this._ws.sendMsg('{}');
|
||||
} catch (e) {
|
||||
}
|
||||
|
||||
this._waitingForPong = true;
|
||||
this._setAlarm(prefs.get("requestTimeout"));
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче