Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fs: fix createReadStream(…, {end: n}) for non-seekable fds #19329

Closed
wants to merge 3 commits into from

Commits on Mar 14, 2018

  1. fs: fix createReadStream(…, {end: n}) for non-seekable fds

    82bdf8f fixed an issue by silently modifying the `start`
    option for the case when only `end` is passed, in order to perform
    reads from a specified range in the file.
    
    However, that approach does not work for non-seekable files, since
    a numeric `start` option means that positioned reads will be used
    to read data from the file.
    
    This patch fixes that, and instead ends reading after a specified
    size by adjusting the read buffer size.
    
    This way we avoid re-introducing the bug that 82bdf8f fixed,
    and align behaviour with the native file stream mechanism
    introduced in nodejs#18936 as well.
    
    Fixes: nodejs#19240
    Refs: nodejs#18121
    addaleax committed Mar 14, 2018
    Configuration menu
    Copy the full SHA
    cd80ea4 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    25b89b2 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    51b5998 View commit details
    Browse the repository at this point in the history