From d55410193166516c546a0b09129f0c54ad0c61b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20L=C3=83=C2=B3pez?= Date: Mon, 10 Mar 2014 11:59:28 -0400 Subject: [PATCH] Bug 980846 - Second wakeup message does not send the port. r=nsm.nikhil --- dom/push/src/PushService.jsm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/dom/push/src/PushService.jsm b/dom/push/src/PushService.jsm index ed1ba5468a9..eabaaedd865 100644 --- a/dom/push/src/PushService.jsm +++ b/dom/push/src/PushService.jsm @@ -1291,8 +1291,7 @@ this.PushService = { this._retryFailCount = 0; // Openning an available UDP port. - // _listenForUDPWakeup will return the opened port number - this._udpPort = this._listenForUDPWakeup(); + this._listenForUDPWakeup(); let data = { messageType: "hello", @@ -1306,7 +1305,7 @@ this.PushService = { // Hostport is apparently a thing. data["wakeup_hostport"] = { ip: networkState.ip, - port: this._udpPort + port: this._udpServer && this._udpServer.port }; data["mobilenetwork"] = { @@ -1449,7 +1448,7 @@ this.PushService = { * reconnect the WebSocket and get the actual data. */ onPacketReceived: function(aServ, aMessage) { - debug("Recv UDP datagram on port: " + this._udpPort); + debug("Recv UDP datagram on port: " + this._udpServer.port); this._beginWSSetup(); }, @@ -1461,7 +1460,7 @@ this.PushService = { */ onStopListening: function(aServ, aStatus) { debug("UDP Server socket was shutdown. Status: " + aStatus); - this._udpPort = undefined; + this._udpServer = undefined; this._beginWSSetup(); },