mirror of
https://github.com/nodejs/node-v0.x-archive.git
synced 2026-04-28 03:01:10 -04:00
Don't send null data segments
This commit is contained in:
@@ -244,6 +244,7 @@ Object.defineProperty(Stream.prototype, 'readyState', {
|
||||
|
||||
|
||||
Stream.prototype._appendBucket = function (data, encoding, fd) {
|
||||
// TODO reject empty data.
|
||||
var newBucket = { data: data };
|
||||
if (encoding) newBucket.encoding = encoding;
|
||||
if (fd) newBucket.fd = fd;
|
||||
|
||||
@@ -335,6 +335,8 @@ void IOWatcher::Dump(EV_P_ ev_prepare *w, int revents) {
|
||||
|
||||
size_t l = Buffer::Length(buf_object);
|
||||
|
||||
if (l == 0) continue;
|
||||
|
||||
assert(first_offset < l);
|
||||
iov[iovcnt].iov_base = Buffer::Data(buf_object) + first_offset;
|
||||
iov[iovcnt].iov_len = l - first_offset;
|
||||
|
||||
Reference in New Issue
Block a user