diff --git a/lib/net_uv.js b/lib/net_uv.js index 0fcdce9fe9..207a1f4671 100644 --- a/lib/net_uv.js +++ b/lib/net_uv.js @@ -195,7 +195,7 @@ Socket.prototype.end = function(data, encoding) { if (data) this.write(data, encoding); DTRACE_NET_STREAM_END(this); - if (this._flags & FLAG_GOT_EOF) { + if (!this.readable) { this.destroySoon(); } else { this._flags |= FLAG_SHUTDOWN;