pool: minor.

This commit is contained in:
Christopher Jeffrey 2016-05-19 21:09:11 -07:00
parent 712a445b99
commit cd94217abd
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -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.'));
}; };
/** /**