doc: fix streams2 SimpleProtocol example

A non-existing variable `b` was used to queue data for reading.
This commit is contained in:
Iskren Ivov Chernev 2013-03-19 10:58:18 -07:00 committed by Ben Noordhuis
parent bf83251eea
commit 2f4a62c5e1

View File

@ -717,11 +717,11 @@ SimpleProtocol.prototype._transform = function(chunk, encoding, done) {
this.emit('header', this.header);
// now, because we got some extra data, emit this first.
this.push(b);
this.push(chunk.slice(split));
}
} else {
// from there on, just provide the data to our consumer as-is.
this.push(b);
this.push(chunk);
}
done();
};