Change write callback to asynchronous to avoid recursion

This commit is contained in:
murgatroid99 2017-05-16 12:53:57 -07:00
parent 9538b3d5a9
commit d82c77ef02

View File

@ -104,7 +104,7 @@ function _write(chunk, encoding, callback) {
if (this.writeFailed) {
/* Once a write fails, just call the callback immediately to let the caller
flush any pending writes. */
callback();
setImmediate(callback);
}
try {
message = this.serialize(chunk);