Browse Source

doc: fix streams2 SimpleProtocol example

A non-existing variable `b` was used to queue data for reading.
v0.10.1-release
Iskren Ivov Chernev 12 years ago
committed by Ben Noordhuis
parent
commit
2f4a62c5e1
  1. 4
      doc/api/stream.markdown

4
doc/api/stream.markdown

@ -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();
};

Loading…
Cancel
Save