Bug 1012869 - Allow STREAM_WOULD_BLOCK, close transport for others. r=paul, a=lmandel
authorJ. Ryan Stinnett <jryans@gmail.com>
Mon, 09 Jun 2014 13:21:00 -0400
changeset 208201 d2f547476c7969efa4ec15687b1ed474000c199a
parent 208200 d5851385e16ae71738e7c55c6fed362543ff1aff
child 208202 da411590e56d8a0f5d6f622af42726c56f813747
push id494
push userraliiev@mozilla.com
push dateMon, 25 Aug 2014 18:42:16 +0000
treeherdermozilla-release@a3cc3e46b571 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspaul, lmandel
bugs1012869
milestone32.0a2
Bug 1012869 - Allow STREAM_WOULD_BLOCK, close transport for others. r=paul, a=lmandel
toolkit/devtools/transport/transport.js
--- a/toolkit/devtools/transport/transport.js
+++ b/toolkit/devtools/transport/transport.js
@@ -255,18 +255,17 @@ DebuggerTransport.prototype = {
    */
   onOutputStreamReady: DevToolsUtils.makeInfallible(function(stream) {
     if (this._outgoing.length === 0) {
       return;
     }
 
     try {
       this._currentOutgoing.write(stream);
-    } catch(e if e.result == Cr.NS_BASE_STREAM_CLOSED ||
-                 e.result == Cr.NS_ERROR_NET_RESET) {
+    } catch(e if e.result != Cr.NS_BASE_STREAM_WOULD_BLOCK) {
       this.close(e.result);
       return;
     }
 
     this._flushOutgoing();
   }, "DebuggerTransport.prototype.onOutputStreamReady"),
 
   /**
@@ -333,19 +332,17 @@ DebuggerTransport.prototype = {
    * Called when the stream is either readable or closed.
    */
   onInputStreamReady:
   DevToolsUtils.makeInfallible(function(stream) {
     try {
       while(stream.available() && this._incomingEnabled &&
             this._processIncoming(stream, stream.available())) {}
       this._waitForIncoming();
-    } catch(e if e.result == Cr.NS_BASE_STREAM_CLOSED ||
-                 e.result == Cr.NS_ERROR_CONNECTION_REFUSED ||
-                 e.result == Cr.NS_ERROR_OFFLINE) {
+    } catch(e if e.result != Cr.NS_BASE_STREAM_WOULD_BLOCK) {
       this.close(e.result);
     }
   }, "DebuggerTransport.prototype.onInputStreamReady"),
 
   /**
    * Process the incoming data.  Will create a new currently incoming Packet if
    * needed.  Tells the incoming Packet to read as much data as it can, but
    * reading may not complete.  The Packet signals that its data is ready for