mirror of
https://github.com/nodejs/node-v0.x-archive.git
synced 2026-04-28 03:01:10 -04:00
Problem 1: If stream.push() triggers a 'readable' event, and the user calls `read(n)` with some n > the highWaterMark, then the push() will return false (indicating that they should not push any more), but no future 'readable' event is coming (because we're above the highWaterMark). Solution: return true from push() when needReadable is set. Problem 2: A read(n) for n != 0, after the stream had encountered an EOF, would not trigger the 'end' event if the EOF was pushed in synchronously by the _read() function. Solution: Check for ended in stream.read() and schedule an end event if the length now equals 0. Fix #4585