From 0abe42a0f4be80bd659411656503e7ac2c243813 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 30285eec63c..2468e2c84cb 100644 --- a/lib/http.js +++ b/lib/http.js @@ -1494,13 +1494,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); }); };