mirror of https://github.com/nodejs/node.git
Black hole tcp reads after destroy()
parent
899358e797
commit
fcad5e35fd
|
@ -4,6 +4,8 @@ var timers = require('timers');
|
||||||
var util = require('util');
|
var util = require('util');
|
||||||
var assert = require('assert');
|
var assert = require('assert');
|
||||||
|
|
||||||
|
function noop() {};
|
||||||
|
|
||||||
// constructor for lazy loading
|
// constructor for lazy loading
|
||||||
function createPipe() {
|
function createPipe() {
|
||||||
var Pipe = process.binding('pipe_wrap').Pipe;
|
var Pipe = process.binding('pipe_wrap').Pipe;
|
||||||
|
@ -267,6 +269,7 @@ Socket.prototype.destroy = function(exception) {
|
||||||
debug('close');
|
debug('close');
|
||||||
if (this._handle) {
|
if (this._handle) {
|
||||||
this._handle.close();
|
this._handle.close();
|
||||||
|
this._handle.onread = noop;
|
||||||
this._handle = null;
|
this._handle = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue