From 7ac1ba5242d3e2b090d14242a47aa64a12064eba Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 12 Nov 2014 20:09:39 -0500 Subject: [PATCH] Fix file sync error with Hola extension enabled With Hola enabled, uploads were failing with NS_BASE_STREAM CLOSED -- it seems to do something that causes the stream to be read more than once. Adding REOPEN_ON_REWIND fixes this. --- chrome/content/zotero/xpcom/storage/zfs.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/storage/zfs.js b/chrome/content/zotero/xpcom/storage/zfs.js index c1f44ad54..21de3c52d 100644 --- a/chrome/content/zotero/xpcom/storage/zfs.js +++ b/chrome/content/zotero/xpcom/storage/zfs.js @@ -413,7 +413,8 @@ Zotero.Sync.Storage.ZFS = (function () { var fis = Components.classes["@mozilla.org/network/file-input-stream;1"] .createInstance(Components.interfaces.nsIFileInputStream); - fis.init(file, 0x01, 0, Components.interfaces.nsIFileInputStream.CLOSE_ON_EOF); + fis.init(file, 0x01, 0, Components.interfaces.nsIFileInputStream.CLOSE_ON_EOF + | Components.interfaces.nsIFileInputStream.REOPEN_ON_REWIND); var bis = Components.classes["@mozilla.org/network/buffered-input-stream;1"] .createInstance(Components.interfaces.nsIBufferedInputStream)