Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
http: .once() usage in setTimeout
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed May 3, 2012
1 parent 91120e0 commit e3ceee2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/http.js
Expand Up @@ -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);
});
};
Expand Down

0 comments on commit e3ceee2

Please sign in to comment.