Revision 1762dd7e
lib/_stream_readable.js | ||
---|---|---|
163 | 163 |
if (typeof n !== 'number' || n > 0) |
164 | 164 |
state.emittedReadable = false; |
165 | 165 |
|
166 |
// if we're doing read(0) to trigger a readable event, but we |
|
167 |
// already have a bunch of data in the buffer, then just trigger |
|
168 |
// the 'readable' event and move on. |
|
169 |
if (n === 0 && |
|
170 |
state.needReadable && |
|
171 |
state.length >= state.highWaterMark) { |
|
172 |
emitReadable(this); |
|
173 |
return null; |
|
174 |
} |
|
175 |
|
|
166 | 176 |
n = howMuchToRead(n, state); |
167 | 177 |
|
168 | 178 |
// if we've ended, and we're now clear, then finish it up. |
Also available in: Unified diff