www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit fad6174e39c7de1a017c09f6c83d0097b696df3c
parent 238a972ace4b25a2dad70d8968944cd325735343
Author: Dan Stillman <dstillman@zotero.org>
Date:   Tue, 10 Jun 2014 03:50:41 -0400

Fix download retrying

Follow-up from 238a972a

Diffstat:
Mchrome/content/zotero/xpcom/storage/streamListener.js | 5++++-
Mchrome/content/zotero/xpcom/storage/zfs.js | 3++-
2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/chrome/content/zotero/xpcom/storage/streamListener.js b/chrome/content/zotero/xpcom/storage/streamListener.js @@ -192,7 +192,7 @@ Zotero.Sync.Storage.StreamListener.prototype = { Zotero.debug('Request ended with status ' + status); var cancelled = status == 0x804b0002; // NS_BINDING_ABORTED - if (!cancelled && request instanceof Components.interfaces.nsIHttpChannel) { + if (!cancelled && status == 0 && request instanceof Components.interfaces.nsIHttpChannel) { request.QueryInterface(Components.interfaces.nsIHttpChannel); try { status = request.responseStatus; @@ -203,6 +203,9 @@ Zotero.Sync.Storage.StreamListener.prototype = { } request.QueryInterface(Components.interfaces.nsIRequest); } + else { + status = 0; + } if (this._data.streams) { for each(var stream in this._data.streams) { diff --git a/chrome/content/zotero/xpcom/storage/zfs.js b/chrome/content/zotero/xpcom/storage/zfs.js @@ -751,6 +751,8 @@ Zotero.Sync.Storage.ZFS = (function () { throw new Error("Item '" + request.name + "' not found"); } + var self = this; + // Retrieve file info from server to store locally afterwards return getStorageFileInfo(item, request) .then(function (info) { @@ -869,7 +871,6 @@ Zotero.Sync.Storage.ZFS = (function () { + " (" + libraryKey + ") -- retrying download" Components.utils.reportError(msg); Zotero.debug(msg, 1); - Zotero.debug(response, 1); if (_s3Backoff < _maxS3Backoff) { _s3Backoff *= 2; }