From 12f3abb6e42ff34af1b6a8e494b231ee1d1e6f04 Mon Sep 17 00:00:00 2001 From: Edward Lee Date: Wed, 21 Apr 2010 11:10:21 -0700 Subject: [PATCH] Bug 560184 - Proxy authentication: Initial Weave connection attempt doesn't time out [r=mconnor] Delay the abort timer from the constructor in addition to onStartRequest and onDataAvailable in-case the callbacks never get called. --HG-- extra : rebase_source : 1243f3baa468b13f8da28175b10aa99b2341e53a --- services/sync/modules/resource.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/services/sync/modules/resource.js b/services/sync/modules/resource.js index 0b0b698c249..b523bd448ca 100644 --- a/services/sync/modules/resource.js +++ b/services/sync/modules/resource.js @@ -301,6 +301,7 @@ function ChannelListener(onComplete, onProgress, logger) { this._onComplete = onComplete; this._onProgress = onProgress; this._log = logger; + this.delayAbort(); } ChannelListener.prototype = { // Wait 5 minutes before killing a request @@ -317,9 +318,7 @@ ChannelListener.prototype = { this._log.trace(channel.requestMethod + " " + channel.URI.spec); this._data = ''; - - // Create an abort timer to kill dangling requests - Utils.delay(this.abortRequest, this.ABORT_TIMEOUT, this, "abortTimer"); + this.delayAbort(); }, onStopRequest: function Channel_onStopRequest(channel, context, status) { @@ -343,8 +342,13 @@ ChannelListener.prototype = { this._data += siStream.read(count); this._onProgress(); + this.delayAbort(); + }, - // Update the abort timer to wait an extra timeout + /** + * Create or push back the abort timer that kills this request + */ + delayAbort: function delayAbort() { Utils.delay(this.abortRequest, this.ABORT_TIMEOUT, this, "abortTimer"); },