diff --git a/chrome/content/zotero/xpcom/ipc.js b/chrome/content/zotero/xpcom/ipc.js index 81ffbca4d..38c6e9d5c 100755 --- a/chrome/content/zotero/xpcom/ipc.js +++ b/chrome/content/zotero/xpcom/ipc.js @@ -461,7 +461,12 @@ Zotero.IPC.Pipe.DeferredOpen.prototype = { var pump = Components.classes["@mozilla.org/network/input-stream-pump;1"]. createInstance(Components.interfaces.nsIInputStreamPump); - pump.init(fifoStream, -1, -1, 4096, 1, true); + try { + pump.init(fifoStream, 0, 0, true); + } + catch (e) { + pump.init(fifoStream, -1, -1, 4096, 1, true); + } pump.asyncRead(this, null); this._openTime = Date.now(); diff --git a/chrome/content/zotero/xpcom/server.js b/chrome/content/zotero/xpcom/server.js index 6bc4321ba..6b0882681 100755 --- a/chrome/content/zotero/xpcom/server.js +++ b/chrome/content/zotero/xpcom/server.js @@ -136,7 +136,12 @@ Zotero.Server.SocketListener = new function() { var dataListener = new Zotero.Server.DataListener(iStream, oStream); var pump = Components.classes["@mozilla.org/network/input-stream-pump;1"] .createInstance(Components.interfaces.nsIInputStreamPump); - pump.init(iStream, -1, -1, 0, 0, false); + try { + pump.init(iStream, 0, 0, false); + } + catch (e) { + pump.init(iStream, -1, -1, 0, 0, false); + } pump.asyncRead(dataListener, null); } diff --git a/chrome/content/zotero/xpcom/utilities_internal.js b/chrome/content/zotero/xpcom/utilities_internal.js index f5b4385b3..4b7566ff1 100644 --- a/chrome/content/zotero/xpcom/utilities_internal.js +++ b/chrome/content/zotero/xpcom/utilities_internal.js @@ -254,7 +254,12 @@ Zotero.Utilities.Internal = { // Send input stream to stream converter var pump = Components.classes["@mozilla.org/network/input-stream-pump;1"] .createInstance(Components.interfaces.nsIInputStreamPump); - pump.init(is, -1, -1, 0, 0, true); + try { + pump.init(is, 0, 0, true); + } + catch (e) { + pump.init(is, -1, -1, 0, 0, true); + } pump.asyncRead(converter, null); return deferred.promise; @@ -314,7 +319,12 @@ Zotero.Utilities.Internal = { // Send input stream to stream converter var pump = Components.classes["@mozilla.org/network/input-stream-pump;1"] .createInstance(Components.interfaces.nsIInputStreamPump); - pump.init(bis, -1, -1, 0, 0, true); + try { + pump.init(bis, 0, 0, true); + } + catch (e) { + pump.init(bis, -1, -1, 0, 0, true); + } pump.asyncRead(converter, null); return deferred.promise; diff --git a/components/zotero-protocol-handler.js b/components/zotero-protocol-handler.js index 49f7c22fa..624937159 100644 --- a/components/zotero-protocol-handler.js +++ b/components/zotero-protocol-handler.js @@ -1221,7 +1221,12 @@ AsyncChannel.prototype = { //Zotero.debug("AsyncChannel: Got input stream from generator"); var pump = Cc["@mozilla.org/network/input-stream-pump;1"].createInstance(Ci.nsIInputStreamPump); - pump.init(data, -1, -1, 0, 0, true); + try { + pump.init(data, 0, 0, true); + } + catch (e) { + pump.init(data, -1, -1, 0, 0, true); + } pump.asyncRead(listenerWrapper, context); } else if (data instanceof Ci.nsIFile || data instanceof Ci.nsIURI) {