зеркало из https://github.com/mozilla/gecko-dev.git
time out requests after 30 seconds
This commit is contained in:
Родитель
6360e435d6
Коммит
9f0826260d
|
@ -133,6 +133,12 @@ DAVCollection.prototype = {
|
||||||
request.mozBackgroundRequest = true;
|
request.mozBackgroundRequest = true;
|
||||||
request.open(op, this._baseURL + path, true);
|
request.open(op, this._baseURL + path, true);
|
||||||
|
|
||||||
|
// time out requests after 30 seconds
|
||||||
|
let cb = function() { request.abort(); };
|
||||||
|
let listener = new Utils.EventListener(cb);
|
||||||
|
let timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
|
||||||
|
timer.initWithCallback(listener, 30000, timer.TYPE_ONE_SHOT);
|
||||||
|
|
||||||
// Force cache validation
|
// Force cache validation
|
||||||
let channel = request.channel;
|
let channel = request.channel;
|
||||||
channel = channel.QueryInterface(Ci.nsIRequest);
|
channel = channel.QueryInterface(Ci.nsIRequest);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче