Fx60: Update nsIInputStreamPump init() calls

This commit is contained in:
Dan Stillman 2018-02-24 05:04:04 -05:00
parent 78e9db9523
commit 0ad308f5f6
4 changed files with 30 additions and 5 deletions

View file

@ -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();

View file

@ -140,7 +140,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);
}

View file

@ -283,7 +283,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;
@ -343,7 +348,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;

View file

@ -1397,7 +1397,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) {