Bug 1506612 - Check whether the tunnel connection is initiated. r=bagder
authorDragana Damjanovic <dd.mozilla@gmail.com>
Fri, 16 Nov 2018 10:42:56 +0000
changeset 503220 cf97290aeea1015925955b375b220cb16ee77aa4
parent 503219 f377e1c9ae609ed3738bca407d5cc0da6d483725
child 503221 123aad6dbf59e7a800a51403dc732711bf07e1b4
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbagder
bugs1506612
milestone65.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 1506612 - Check whether the tunnel connection is initiated. r=bagder Differential Revision: https://phabricator.services.mozilla.com/D12003
netwerk/protocol/http/TunnelUtils.cpp
--- a/netwerk/protocol/http/TunnelUtils.cpp
+++ b/netwerk/protocol/http/TunnelUtils.cpp
@@ -1416,22 +1416,21 @@ SpdyConnectTransaction::WebsocketWriteSe
     // Force driving transaction to finish so the websocket channel can get its
     // notifications correctly and start driving.
     MOZ_ASSERT(mDrivingTransaction);
     mDrivingTransaction->Close(NS_OK);
   }
 
   nsresult rv = WriteDataToBuffer(writer, count, countWritten);
   if (NS_SUCCEEDED(rv)) {
+    if (!mTunneledConn || !mTunnelStreamIn->GetCallback()) {
+      return NS_BASE_STREAM_WOULD_BLOCK;
+    }
     nsIInputStreamCallback *cb = mTunnelStreamIn->GetCallback();
-    if (!cb) {
-      rv = NS_BASE_STREAM_WOULD_BLOCK;
-    } else {
-      rv = cb->OnInputStreamReady(mTunnelStreamIn);
-    }
+    rv = cb->OnInputStreamReady(mTunnelStreamIn);
   }
 
   return rv;
 }
 
 bool
 SpdyConnectTransaction::ConnectedReadyForInput()
 {