From e3ceee2dce63425f5c105d23a202dd4298507449 Mon Sep 17 00:00:00 2001 From: isaacs Date: Thu, 3 May 2012 10:39:16 -0700 Subject: [PATCH] http: .once() usage in setTimeout --- lib/http.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/http.js b/lib/http.js index 06d98d0b976..4c55db0c8c4 100644 --- a/lib/http.js +++ b/lib/http.js @@ -1335,13 +1335,13 @@ ClientRequest.prototype.setTimeout = function(msecs, callback) { } if (this.socket) { - this.socket.on('connect', function() { + this.socket.once('connect', function() { this.setTimeout(msecs, emitTimeout); }); return; } - this.on('socket', function(sock) { + this.once('socket', function(sock) { this.setTimeout(msecs, emitTimeout); }); };