Skip to content

Instantly share code, notes, and snippets.

@max-mapper
Created February 11, 2014 17:19
Show Gist options
  • Save max-mapper/8939473 to your computer and use it in GitHub Desktop.
Save max-mapper/8939473 to your computer and use it in GitHub Desktop.
stream._write = function (buf, enc, next) {
// dont send terminate signal
console.log('WRITE', [buf, buf.toString()])
if (buf.length === 4 && buf[buf.length-1] === 48
&& buf[buf.length-2] === 48 && buf[buf.length-3] === 48
&& buf[buf.length-4] === 48) stream.needsPktFlush = true
else backend.push(buf)
if (backend._ready) next()
else stream._next = next;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment