Fix GH-819. Drop out if connection destroyed before connect()

This commit is contained in:
Ryan Dahl 2011-03-21 14:48:26 -07:00
parent 7e28630f5e
commit d7a86ff05e
2 changed files with 9 additions and 0 deletions

View File

@ -547,6 +547,8 @@ Socket.prototype.setEncoding = function(encoding) {
function doConnect(socket, port, host) {
if (socket.destroyed) return;
timers.active(socket);
try {

View File

@ -0,0 +1,7 @@
var common = require('../common');
var net = require('net');
var assert = require('assert');
// Connect to something that we need to DNS resolve
var c = net.createConnection(80, "google.com");
c.destroy();