зеркало из https://github.com/mozilla/pjs.git
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
This commit is contained in:
Родитель
04e6b1f9a8
Коммит
12f3abb6e4
|
@ -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");
|
||||
},
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче