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: e501ce4b218f
Choose a base ref
...
head repository: nodejs/node-v0.x-archive
compare: 27fafd464870
Choose a head ref
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Jan 14, 2013

  1. stream: Do not call endReadable on a non-empty stream

    Say that a stream's current read queue has 101 bytes in it, and the
    underlying resource has ended (ie, reached EOF).
    
    If you do something like this:
    
        stream.read(100); // leave a byte behind
        stream.read(0); // read(0) for some reason
    
    then the read(0) will get 0 from the howMuchToRead function.  Since the
    stream was ended, this was incorrectly treating the 0 as a "there is no
    more in the buffer", and emitting 'end' before that last byte was read.
    
    Why have the read(0) in the first place?  We do this in some cases to
    trigger the last few bytes of a net socket (such as a child process's
    stdio pipes).  This was causing issues when piping a `git archive` job
    to a file: the resulting tarball was incomplete, because it occasionally
    was not getting the last chunk.
    isaacs committed Jan 14, 2013
    Copy the full SHA
    27fafd4 View commit details
    Browse the repository at this point in the history