Permalink
Browse files

connection: ensure control socket still exists when PASV callback is …

…reached
  • Loading branch information...
1 parent 552875b commit 8d718729a953e8b58d128fb3c1bf2cd83ae48206 @mscdex committed Aug 1, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/connection.js
View
@@ -56,6 +56,7 @@ var /*TYPE = {
var FTP = module.exports = function() {
if (!(this instanceof FTP))
return new FTP();
+
this._socket = undefined;
this._pasvSock = undefined;
this._feat = undefined;
@@ -790,7 +791,7 @@ FTP.prototype._pasv = function(cb) {
// try the IP of the control connection if the server was somehow
// misconfigured and gave for example a LAN IP instead of WAN IP over
// the Internet
- if (ip !== self._socket.remoteAddress) {
+ if (self._socket && ip !== self._socket.remoteAddress) {
ip = self._socket.remoteAddress;
return reentry();
}

0 comments on commit 8d71872

Please sign in to comment.