Comparing version 0.1.2 to 0.1.3
68
ftp.js
@@ -273,6 +273,5 @@ var util = require('util'), | ||
if (r) { | ||
instream.pipe(outstream); | ||
instream.resume(); | ||
instream.pipe(outstream); | ||
} | ||
else | ||
} else | ||
cb(new Error('Connection severed')); | ||
@@ -478,3 +477,3 @@ }); | ||
} | ||
if (this._queue.length) { | ||
if (this._queue.length) { | ||
var fullcmd = this._queue[0][0] | ||
@@ -529,8 +528,8 @@ + (this._queue[0].length === 3 ? ' ' + this._queue[0][1] : ''); | ||
var r = self.send('ABOR', function(e) { | ||
if (e) | ||
return self._callCb(e); | ||
self._dataSock.destroy(); | ||
self._dataSock = self._pasvPort = self._pasvIP = undefined; | ||
self._callCb(new Error('(PASV) Data connection timed out while connecting')); | ||
}); | ||
self._dataSock.end(); | ||
self._pasvPort = self._pasvIP = undefined; | ||
if (e) | ||
return self._callCb(e); | ||
self._callCb(new Error('(PASV) Data connection timed out while connecting')); | ||
}); | ||
if (!r) | ||
@@ -544,25 +543,28 @@ self._callCb(new Error('Connection severed')); | ||
this._dataSock = net.createConnection(this._pasvPort, this._pasvIP); | ||
this._dataSock.on('connect', function() { | ||
clearTimeout(pasvTimeout); | ||
if (debug) | ||
debug('(PASV) Data connection successful'); | ||
self._callCb(self._dataSock); | ||
}); | ||
this._dataSock.on('end', function() { | ||
if (debug) | ||
debug('(PASV) Data connection closed'); | ||
self._dataSock = self._pasvPort = self._pasvIP = undefined; | ||
}); | ||
this._dataSock.on('close', function() { | ||
clearTimeout(pasvTimeout); | ||
}); | ||
this._dataSock.on('error', function(err) { | ||
if (debug) | ||
debug('(PASV) Error: ' + err); | ||
self._callCb(err); | ||
self._dataSock = self._pasvPort = self._pasvIP = undefined; | ||
}); | ||
if (!this._dataSock) { | ||
this._dataSock = new net.Socket(); | ||
this._dataSock.on('connect', function() { | ||
clearTimeout(pasvTimeout); | ||
if (debug) | ||
debug('(PASV) Data connection successful'); | ||
self._callCb(self._dataSock); | ||
}); | ||
this._dataSock.on('end', function() { | ||
if (debug) | ||
debug('(PASV) Data connection closed'); | ||
self._pasvPort = self._pasvIP = undefined; | ||
}); | ||
this._dataSock.on('close', function() { | ||
clearTimeout(pasvTimeout); | ||
}); | ||
this._dataSock.on('error', function(err) { | ||
if (debug) | ||
debug('(PASV) Error: ' + err); | ||
self._pasvPort = self._pasvIP = undefined | ||
self._callCb(err); | ||
}); | ||
} | ||
this._dataSock.connect(this._pasvPort, this._pasvIP); | ||
return true; | ||
@@ -726,3 +728,3 @@ }; | ||
function getGroup(code) { | ||
return parseInt(code/10)%10; | ||
return parseInt(code / 10) % 10; | ||
} | ||
@@ -729,0 +731,0 @@ |
{ "name": "ftp", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"author": "Brian White <mscdex@mscdex.net>", | ||
@@ -4,0 +4,0 @@ "description": "An FTP client module for node.js", |
@@ -20,3 +20,3 @@ Description | ||
* Get a directory listing of the current working directory: | ||
* Get a pretty-printed directory listing of the current (remote) working directory: | ||
@@ -23,0 +23,0 @@ var FTPClient = require('./ftp'), util = require('util'), conn; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Non-existent author
Supply chain riskThe package was published by an npm account that no longer exists.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
801
2
45335
1