Bug 1421989 - Adding an error check in TCPSocket::BufferedAmount(), r=qdot
authorAndrea Marchesini <amarchesini@mozilla.com>
Sat, 02 Dec 2017 21:06:34 +0100
changeset 394595 1815a9a4c8d56abc94aa46e44fdf7d333168b5a4
parent 394594 799ed2f23d7d72c2b444ff67848a4cf03277d1d8
child 394601 06e34f070bf91f989261c974ad2246c734979e2d
push id97926
push useramarchesini@mozilla.com
push dateSat, 02 Dec 2017 20:06:55 +0000
treeherdermozilla-inbound@1815a9a4c8d5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersqdot
bugs1421989
milestone59.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 1421989 - Adding an error check in TCPSocket::BufferedAmount(), r=qdot
dom/network/TCPSocket.cpp
--- a/dom/network/TCPSocket.cpp
+++ b/dom/network/TCPSocket.cpp
@@ -593,17 +593,18 @@ uint64_t
 TCPSocket::BufferedAmount()
 {
   if (mSocketBridgeChild) {
     return mBufferedAmount;
   }
   if (mMultiplexStream) {
     uint64_t available = 0;
     nsCOMPtr<nsIInputStream> stream(do_QueryInterface(mMultiplexStream));
-    stream->Available(&available);
+    nsresult rv = stream->Available(&available);
+    NS_ENSURE_SUCCESS(rv, 0);
     return available;
   }
   return 0;
 }
 
 void
 TCPSocket::Suspend()
 {