pool: minor.
This commit is contained in:
parent
712a445b99
commit
cd94217abd
@ -2036,11 +2036,15 @@ function LoadRequest(pool, peer, type, hash, callback) {
|
|||||||
assert(!this.pool.request.map[this.hash]);
|
assert(!this.pool.request.map[this.hash]);
|
||||||
this.pool.request.map[this.hash] = this;
|
this.pool.request.map[this.hash] = this;
|
||||||
|
|
||||||
this._finish = this._ontimeout.bind(this);
|
this._finish = this.destroy.bind(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
LoadRequest.prototype._ontimeout = function _ontimeout() {
|
/**
|
||||||
this.finish(new Error('Timeout.'));
|
* Destroy load request with an error.
|
||||||
|
*/
|
||||||
|
|
||||||
|
LoadRequest.prototype.destroy = function destroy() {
|
||||||
|
this.finish(new Error('Timeout or closed.'));
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user