aboutsummaryrefslogtreecommitdiff
path: root/AUTHORS
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2013-03-09 18:05:39 -0800
committerisaacs <i@izs.me>2013-03-10 11:08:22 -0700
commit327b6e3e1de88ba1db83142d53b3a57f0d06d519 (patch)
treebdd519bbef7ce32b9442fa49df9346e742c8b708 /AUTHORS
parentcd2b9f542c34ce59d2df7820a6237f7911c702f3 (diff)
downloadandroid-node-v8-327b6e3e1de88ba1db83142d53b3a57f0d06d519.tar.gz
android-node-v8-327b6e3e1de88ba1db83142d53b3a57f0d06d519.tar.bz2
android-node-v8-327b6e3e1de88ba1db83142d53b3a57f0d06d519.zip
stream: Don't emit 'end' unless read() called
This solves the problem of calling `readable.pipe(writable)` after the readable stream has already emitted 'end', as often is the case when writing simple HTTP proxies. The spirit of streams2 is that things will work properly, even if you don't set them up right away on the first tick. This approach breaks down, however, because pipe()ing from an ended readable will just do nothing. No more data will ever arrive, and the writable will hang open forever never being ended. However, that does not solve the case of adding a `on('end')` listener after the stream has received the EOF chunk, if it was the first chunk received (and thus, length was 0, and 'end' got emitted). So, with this, we defer the 'end' event emission until the read() function is called. Also, in pipe(), if the source has emitted 'end' already, we call the cleanup/onend function on nextTick. Piping from an already-ended stream is thus the same as piping from a stream that is in the process of ending. Updates many tests that were relying on 'end' coming immediately, even though they never read() from the req. Fix #4942
Diffstat (limited to 'AUTHORS')
0 files changed, 0 insertions, 0 deletions