Bug 817983 - Disconnect first so that we force ourselves to actually try again. r=vchang
authorBlake Kaplan <mrbkap@gmail.com>
Thu, 06 Dec 2012 13:27:14 -0800
changeset 115247 95b05aca04a370c56d41a821e5c41b3f20bc9199
parent 115246 8a0c82cf76ab86dd24db0b17eafadea2610b9659
child 115248 63e3a9b10f15e794535862f839c00a2d5bae54bd
push id23991
push useremorley@mozilla.com
push dateFri, 07 Dec 2012 14:14:29 +0000
treeherdermozilla-central@8432562db685 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvchang
bugs817983
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 817983 - Disconnect first so that we force ourselves to actually try again. r=vchang
dom/wifi/WifiWorker.js
--- a/dom/wifi/WifiWorker.js
+++ b/dom/wifi/WifiWorker.js
@@ -1936,17 +1936,21 @@ function WifiWorker() {
 
       // We start the connection information timer when we associate, but
       // don't have our IP address until here. Make sure that we fire a new
       // connectionInformation event with the IP address the next time the
       // timer fires.
       self._lastConnectionInfo = null;
       self._fireEvent("onconnect", { network: netToDOM(self.currentNetwork) });
     } else {
-      WifiManager.reassociate(function(){});
+      // NB: We have to call disconnect first. Otherwise, we only reauth with
+      // the existing AP and don't retrigger DHCP.
+      WifiManager.disconnect(function() {
+        WifiManager.reassociate(function(){});
+      });
     }
   };
 
   WifiManager.onscanresultsavailable = function() {
     if (self._scanStuckTimer) {
       // We got scan results! We must not be stuck for now, try again.
       self._scanStuckTimer.cancel();
       self._scanStuckTimer.initWithCallback(scanIsStuck, SCAN_STUCK_WAIT,