Browse Source

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

v0.7.4-release
Ryan Dahl 14 years ago
parent
commit
d7a86ff05e
  1. 2
      lib/net.js
  2. 7
      test/simple/test-regress-GH-819.js

2
lib/net.js

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

7
test/simple/test-regress-GH-819.js

@ -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();
Loading…
Cancel
Save