request: silence errors after cleanup.
This commit is contained in:
parent
6ea846ee9a
commit
e36adec092
@ -308,12 +308,14 @@ Request.prototype.cleanup = function cleanup() {
|
||||
if (this.request) {
|
||||
this.request.removeListener('response', this.onResponse);
|
||||
this.request.removeListener('error', this.onEnd);
|
||||
this.request.addListener('error', nop);
|
||||
}
|
||||
|
||||
if (this.response) {
|
||||
this.response.removeListener('data', this.onData);
|
||||
this.response.removeListener('error', this.onEnd);
|
||||
this.response.removeListener('end', this.onEnd);
|
||||
this.response.addListener('error', nop);
|
||||
}
|
||||
};
|
||||
|
||||
@ -621,6 +623,8 @@ function ensureRequires(ssl) {
|
||||
StringDecoder = require('string_decoder').StringDecoder;
|
||||
}
|
||||
|
||||
function nop() {}
|
||||
|
||||
/*
|
||||
* Expose
|
||||
*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user