diff --git a/lib/Connection.js b/lib/Connection.js index 4b33bb4..ca0dc78 100644 --- a/lib/Connection.js +++ b/lib/Connection.js @@ -171,8 +171,12 @@ Connection.prototype.connect = function() { self.debug && self.debug('=> ' + inspect(CRLF)); self._sock.write(CRLF); } else if (type === 'APPEND') { + var val = self._curReq.appendData; + if (Buffer.isBuffer(self._curReq.appendData)) + val = val.toString('utf8'); self.debug && self.debug('=> ' + inspect(self._curReq.appendData)); self._sock.write(self._curReq.appendData); + self._sock.write(CRLF); } else if (self._curReq.lines && self._curReq.lines.length) { var line = self._curReq.lines.shift() + '\r\n'; self.debug && self.debug('=> ' + inspect(line));