From 46cce5a2bd7e952cd7ed5bce555fcd15bcce5f65 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 17 Jul 2013 18:55:43 -0400 Subject: [PATCH] Extra debugging for file sync hangs on slow connections --- .../zotero/xpcom/storage/streamListener.js | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/chrome/content/zotero/xpcom/storage/streamListener.js b/chrome/content/zotero/xpcom/storage/streamListener.js index e4e6779f3..4bf22e876 100644 --- a/chrome/content/zotero/xpcom/storage/streamListener.js +++ b/chrome/content/zotero/xpcom/storage/streamListener.js @@ -49,12 +49,12 @@ Zotero.Sync.Storage.StreamListener.prototype = { if (progress > progressMax) { progress = progressMax; } - //Zotero.debug("onProgress with " + progress + "/" + progressMax); + Zotero.debug("onProgress with " + progress + "/" + progressMax); this._onProgress(request, progress, progressMax); }, onStatus: function (request, context, status, statusArg) { - //Zotero.debug('onStatus'); + Zotero.debug('onStatus with ' + status); }, // nsIRequestObserver @@ -67,7 +67,7 @@ Zotero.Sync.Storage.StreamListener.prototype = { }, onStopRequest: function (request, context, status) { - Zotero.debug('onStopRequest'); + Zotero.debug('onStopRequest with ' + status); switch (status) { case 0: @@ -84,7 +84,7 @@ Zotero.Sync.Storage.StreamListener.prototype = { // nsIWebProgressListener onProgressChange: function (wp, request, curSelfProgress, maxSelfProgress, curTotalProgress, maxTotalProgress) { - //Zotero.debug("onProgressChange with " + curTotalProgress + "/" + maxTotalProgress); + Zotero.debug("onProgressChange with " + curTotalProgress + "/" + maxTotalProgress); // onProgress gets called too, so this isn't necessary //this._onProgress(request, curTotalProgress, maxTotalProgress); @@ -108,8 +108,12 @@ Zotero.Sync.Storage.StreamListener.prototype = { onStatusChange: function (progress, request, status, message) { Zotero.debug("onStatusChange with '" + message + "'"); }, - onLocationChange: function () {}, - onSecurityChange: function () {}, + onLocationChange: function () { + Zotero.debug('onLocationChange'); + }, + onSecurityChange: function () { + Zotero.debug('onSecurityChange'); + }, // nsIStreamListener onDataAvailable: function (request, context, stream, sourceOffset, length) { @@ -119,7 +123,9 @@ Zotero.Sync.Storage.StreamListener.prototype = { .createInstance(Components.interfaces.nsIScriptableInputStream); scriptableInputStream.init(stream); - this._response += scriptableInputStream.read(length); + var data = scriptableInputStream.read(length); + Zotero.debug(data); + this._response += data; }, // nsIChannelEventSink