Bug 1152041 - Do not try to reconnect if we are offline. r=mayhemer
authorDragana Damjanovic <dd.mozilla@gmail.com>
Sat, 09 May 2015 09:27:00 -0400
changeset 244957 69fcbc1da823e8d9edd471b6a86ac84405ed24d4
parent 244956 37cf24967016342b1bfe069c32321489d730bec3
child 244958 555d78bff49cbf2121d73cab491c591d269146b4
push id60067
push userryanvm@gmail.com
push dateThu, 21 May 2015 13:52:02 +0000
treeherdermozilla-inbound@6635e368ea9e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmayhemer
bugs1152041
milestone41.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 1152041 - Do not try to reconnect if we are offline. r=mayhemer
netwerk/base/nsSocketTransport2.cpp
--- a/netwerk/base/nsSocketTransport2.cpp
+++ b/netwerk/base/nsSocketTransport2.cpp
@@ -1917,17 +1917,18 @@ nsSocketTransport::OnSocketDetached(PRFi
         if (gIOService->IsOffline()) {
           mCondition = NS_ERROR_OFFLINE;
         }
         else {
           mCondition = NS_ERROR_ABORT;
         }
     }
 
-    if (RecoverFromError())
+    // If we are not offline try again.
+    if (!gIOService->IsOffline() && RecoverFromError())
         mCondition = NS_OK;
     else {
         mState = STATE_CLOSED;
 
         // make sure there isn't any pending DNS request
         if (mDNSRequest) {
             mDNSRequest->Cancel(NS_ERROR_ABORT);
             mDNSRequest = 0;