Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: nodejs/node-v0.x-archive
base: cd2b9f542c34
Choose a base ref
...
head repository: nodejs/node-v0.x-archive
compare: 327b6e3e1de8
Choose a head ref
  • 1 commit
  • 15 files changed
  • 1 contributor

Commits on Mar 10, 2013

  1. 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
    isaacs committed Mar 10, 2013
    1
    Copy the full SHA
    327b6e3 View commit details
    Browse the repository at this point in the history