Skip to content

Commit

Permalink
connection: use 'on' instead of 'once' for error event
Browse files Browse the repository at this point in the history
  • Loading branch information
mscdex committed Nov 12, 2013
1 parent f9d3567 commit fd50ede
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/connection.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ FTP.prototype.connect = function(options) {
socket.setEncoding('binary'); socket.setEncoding('binary');
socket.on('data', ondata); socket.on('data', ondata);
socket.once('end', onend); socket.once('end', onend);
socket.once('error', onerror); socket.on('error', onerror);
} }
} }
} }
Expand All @@ -273,7 +273,7 @@ FTP.prototype.connect = function(options) {
self._parser.write(chunk); self._parser.write(chunk);
} }


socket.once('error', onerror); socket.on('error', onerror);
function onerror(err) { function onerror(err) {
clearTimeout(timer); clearTimeout(timer);
clearTimeout(self._keepalive); clearTimeout(self._keepalive);
Expand Down

0 comments on commit fd50ede

Please sign in to comment.