www

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

commit 950e1a50474f35283dc33eba3bdda25a44f3e35f
parent ec28c5a35d6a846b54312aac16edfddd810de3b5
Author: Dan Stillman <dstillman@zotero.org>
Date:   Mon,  1 Feb 2016 04:01:03 -0500

Don't call stop handler twice in storage stream listener

The second status code would be 0, so it could result in spurious
S3 retries.

Backported from master

Diffstat:
Mchrome/content/zotero/xpcom/storage/streamListener.js | 14+++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/chrome/content/zotero/xpcom/storage/streamListener.js b/chrome/content/zotero/xpcom/storage/streamListener.js @@ -114,13 +114,13 @@ Zotero.Sync.Storage.StreamListener.prototype = { Zotero.debug(stateFlags); Zotero.debug(status); - if ((stateFlags & Components.interfaces.nsIWebProgressListener.STATE_START) - && (stateFlags & Components.interfaces.nsIWebProgressListener.STATE_IS_NETWORK)) { - this._onStart(request); - } - else if ((stateFlags & Components.interfaces.nsIWebProgressListener.STATE_STOP) - && (stateFlags & Components.interfaces.nsIWebProgressListener.STATE_IS_NETWORK)) { - this._onStop(request, status); + if (stateFlags & Components.interfaces.nsIWebProgressListener.STATE_IS_REQUEST) { + if (stateFlags & Components.interfaces.nsIWebProgressListener.STATE_START) { + this._onStart(request); + } + else if (stateFlags & Components.interfaces.nsIWebProgressListener.STATE_STOP) { + this._onStop(request, status); + } } },