Comparing version 0.2.7 to 0.2.8
@@ -293,3 +293,3 @@ /* | ||
"test get fileList array": function(next) { | ||
">test get fileList array": function(next) { | ||
var ftp = this.ftp; | ||
@@ -296,0 +296,0 @@ var file1 = "testfile.txt"; |
29
jsftp.js
@@ -46,6 +46,2 @@ /* | ||
buffer = bufs[i]; | ||
if (!Buffer.isBuffer(buffer)) | ||
buffer = bufs[i] = new Buffer(buffer); | ||
length += buffer.length; | ||
@@ -56,6 +52,4 @@ } | ||
bufs.forEach(function (buf, i) { | ||
buf = bufs[i]; | ||
buf.copy(buffer, index, 0, buf.length); | ||
index += buf.length; | ||
delete bufs[i]; | ||
}); | ||
@@ -376,3 +370,2 @@ | ||
var port = (parseInt(match[1], 10) & 255) * 256 + (parseInt(match[2], 10) & 255); | ||
var contents; | ||
@@ -386,16 +379,22 @@ var onConnect = function() { | ||
var pieces = []; | ||
var onData = function(result) { | ||
if (data.mode === "I") | ||
contents = concat([contents || [], result]); | ||
else | ||
contents = [contents, result].join("\n"); | ||
pieces.push(result); | ||
}; | ||
var onEnd = function(error) { | ||
callback(error, contents); | ||
if (error) | ||
callback(error); | ||
else if (data.mode === "I") | ||
callback(null, concat(pieces)); | ||
else | ||
callback(null, pieces.join("\n")); | ||
}; | ||
var psvSocket = Net.createConnection(port, self.host); | ||
psvSocket.setEncoding("utf8"); | ||
psvSocket.on("connect", onConnect); | ||
if (data.mode !== "I") { | ||
psvSocket.setEncoding("utf8"); | ||
} | ||
psvSocket.once("connect", onConnect); | ||
psvSocket.on("data", onData); | ||
@@ -408,3 +407,3 @@ psvSocket.on("end", onEnd); | ||
// operation. | ||
this.raw.type(data.mode || "I", function(err, res) { | ||
this.raw.type(data.mode, function(err, res) { | ||
self.push(["pasv", doPasv]); | ||
@@ -411,0 +410,0 @@ }); |
{ | ||
"name": "jsftp", | ||
"id": "jsftp", | ||
"version": "0.2.7", | ||
"version": "0.2.8", | ||
"description": "A sane FTP client implementation for NodeJS", | ||
@@ -17,3 +17,3 @@ "keywords": [ "ftp", "protocol", "files", "server", "client", "async" ], | ||
"dependencies": { | ||
"gab": ">=0.0.1" | ||
"gab": ">=0.0.2" | ||
}, | ||
@@ -20,0 +20,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
332742
2
23
1508
Updatedgab@>=0.0.2