mirror of https://github.com/nodejs/node.git
Don't send null data segments
parent
d74c506044
commit
5ba0be6166
|
@ -244,6 +244,7 @@ Object.defineProperty(Stream.prototype, 'readyState', {
|
||||||
|
|
||||||
|
|
||||||
Stream.prototype._appendBucket = function (data, encoding, fd) {
|
Stream.prototype._appendBucket = function (data, encoding, fd) {
|
||||||
|
// TODO reject empty data.
|
||||||
var newBucket = { data: data };
|
var newBucket = { data: data };
|
||||||
if (encoding) newBucket.encoding = encoding;
|
if (encoding) newBucket.encoding = encoding;
|
||||||
if (fd) newBucket.fd = fd;
|
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);
|
size_t l = Buffer::Length(buf_object);
|
||||||
|
|
||||||
|
if (l == 0) continue;
|
||||||
|
|
||||||
assert(first_offset < l);
|
assert(first_offset < l);
|
||||||
iov[iovcnt].iov_base = Buffer::Data(buf_object) + first_offset;
|
iov[iovcnt].iov_base = Buffer::Data(buf_object) + first_offset;
|
||||||
iov[iovcnt].iov_len = l - first_offset;
|
iov[iovcnt].iov_len = l - first_offset;
|
||||||
|
|
Loading…
Reference in New Issue