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

Commits on Mar 10, 2013

  1. stream: Avoid nextTick warning filling read buffer

    In the function that pre-emptively fills the Readable queue, it relies
    on a recursion through:
    
    stream.push(chunk) ->
    maybeReadMore(stream, state) ->
      if (not reading more and < hwm) stream.read(0) ->
    stream._read() ->
    stream.push(chunk) -> repeat.
    
    Since this was only calling read() a single time, and then relying on a
    future nextTick to collect more data, it ends up causing a nextTick
    recursion error (and potentially a RangeError, even) if you have a very
    high highWaterMark, and are getting very small chunks pushed
    synchronously in _read (as happens with TLS, or many simple test
    streams).
    
    This change implements a new approach, so that read(0) is called
    repeatedly as long as it is effective (that is, the length keeps
    increasing), and thus quickly fills up the buffer for streams such as
    these, without any stacks overflowing.
    isaacs committed Mar 10, 2013
    Copy the full SHA
    cd2b9f5 View commit details
    Browse the repository at this point in the history