Comparing version 0.2.0 to 0.2.1
{ | ||
"name": "emailjs", | ||
"description": "send text/html emails and attachments (files, streams and strings) from node.js to any smtp server", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"author": "eleith", | ||
@@ -6,0 +6,0 @@ "contributors":["izuzak", "Hiverness", "mscdex"], |
@@ -1,2 +0,2 @@ | ||
# emailjs (v0.2.0) | ||
# emailjs (v0.2.1) | ||
@@ -3,0 +3,0 @@ send emails, html and attachments (files, streams and strings) from node.js to any smtp server |
@@ -427,7 +427,9 @@ var stream = require('stream'); | ||
{ | ||
var bytes = Buffer.byteLength(data); | ||
// can we buffer the data? | ||
if(data.length + self.bufferIndex < self.buffer.length) | ||
if(bytes + self.bufferIndex < self.buffer.length) | ||
{ | ||
self.buffer.write(data, self.bufferIndex); | ||
self.bufferIndex += data.length; | ||
self.bufferIndex += bytes; | ||
@@ -437,3 +439,3 @@ if(callback) | ||
} | ||
else if(data.length > self.buffer.length) | ||
else if(bytes > self.buffer.length) | ||
{ | ||
@@ -448,3 +450,3 @@ close({message:"internal buffer got too large to handle!"}); | ||
self.buffer.write(data, 0); | ||
self.bufferIndex = data.length; | ||
self.bufferIndex = bytes; | ||
@@ -451,0 +453,0 @@ // we could get paused after emitting data... |
3934453
1808