write-only streams should not shutdown
authorRyan Dahl <ry@tinyclouds.org>
Tue, 27 Sep 2011 06:25:48 +0000 (23:25 -0700)
committerRyan Dahl <ry@tinyclouds.org>
Tue, 27 Sep 2011 06:25:50 +0000 (23:25 -0700)
See
https://github.com/joyent/node/issues/1726#issuecomment-2207602

lib/net_uv.js

index 0fcdce9..207a1f4 100644 (file)
@@ -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;