Permalink
Browse files

clear keepalive timeout on control socket disconnection

  • Loading branch information...
1 parent ff09045 commit 1dd58ec0b65d17a4e09880d55ca76b2302c6e6a1 @mscdex committed Dec 17, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 ftp.js
View
3 ftp.js
@@ -119,6 +119,7 @@ FTP.prototype.connect = function(options) {
this._socket.once('connect', function() {
clearTimeout(timer);
+ clearTimeout(keepalive);
self.connected = true;
var cmd;
self._curReq = {
@@ -204,6 +205,7 @@ FTP.prototype.connect = function(options) {
this._socket.once('error', function(err) {
clearTimeout(timer);
+ clearTimeout(keepalive);
self.emit('error', err);
});
@@ -222,6 +224,7 @@ FTP.prototype.connect = function(options) {
if (!hasReset) {
hasReset = true;
clearTimeout(timer);
+ clearTimeout(keepalive);
self.connected = false;
self._reset();
}

0 comments on commit 1dd58ec

Please sign in to comment.