Permalink
Browse files

connection: use a single socket.write() call

Some FTP server implementations expect the entirety of a request to be contained within a single packet.
  • Loading branch information...
mscdex committed Aug 1, 2013
1 parent e9c43fc commit fb7c34a3f721bf6dd4b3697c61943195eee89241
Showing with 1 addition and 3 deletions.
  1. +1 −3 lib/connection.js
View
@@ -50,7 +50,6 @@ var /*TYPE = {
552: 'Requested file action aborted / Exceeded storage allocation (for current directory or dataset)',
553: 'Requested action not taken / File name not allowed'
},*/
- bytesCRLF = new Buffer([13, 10]),
bytesNOOP = new Buffer('NOOP\r\n');
var FTP = module.exports = function() {
@@ -953,8 +952,7 @@ FTP.prototype._send = function(cmd, cb, promote) {
if (this._curReq.cmd === 'ABOR' && this._pasvSocket)
this._pasvSocket.aborting = true;
this._debug&&this._debug('[connection] > ' + inspect(this._curReq.cmd));
- this._socket.write(this._curReq.cmd);
- this._socket.write(bytesCRLF);
+ this._socket.write(this._curReq.cmd + '\r\n');
} else if (!this._curReq && !queueLen && this._ending)
this._reset();
};

0 comments on commit fb7c34a

Please sign in to comment.