diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2011-01-12 10:57:01 -0800 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2011-01-12 10:57:03 -0800 |
commit | 33c33949b2965512e6e058e6e1e5c800a617d071 (patch) | |
tree | d66da55b65ae48c3f0c6d033db696719d2424010 /lib | |
parent | 72589b60ada148467caa42912585316cde0ce3e8 (diff) | |
download | node-new-33c33949b2965512e6e058e6e1e5c800a617d071.tar.gz |
Add test for connection timeouts
Also make socket.end() destroy connection if still trying to connect.
Previously was ignoring.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/net.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/net.js b/lib/net.js index 8dbdecd360..facb975ff0 100644 --- a/lib/net.js +++ b/lib/net.js @@ -783,7 +783,9 @@ Socket.prototype._shutdown = function() { Socket.prototype.end = function(data, encoding) { - if (this.writable) { + if (this._connecting) { + this.destroy(); + } else if (this.writable) { if (this._writeQueueLast() !== END_OF_FILE) { if (data) this.write(data, encoding); this._writeQueue.push(END_OF_FILE); |