stream: Don't signal EOF on '' or Buffer(0)
Those values, if passed to the _read() cb, will not signal an EOF. Only null or undefined will mark the end of data, and trigger the end event. However, great care must be taken if you are returning an empty string or buffer! There must be some other thing somewhere that will trigger a read() call, because there will never be a readable event fired later. This is in preparation for CryptoStreams being ported to streams2, where it is safe to simply stop reading, because the crypto cycle process will cause it to read(0) again at some future date.
parent
01681091
Please register or sign in to comment