Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc: fix onReadable reentry after unshift called
In example parseHeader, stream listen **readable** event, if call stream.unshift(buf) before stream.removeListener('readable', onReadable), readable event will be emited before removeListener, so callback will not been called correctlly. After change to ```js stream.removeListener('error', callback); stream.removeListener('readable', onReadable); if (buf.length) stream.unshift(buf); ``` It solves this problem. PR-URL: #8200 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
- Loading branch information