Files
node/lib
Anna Henningsen f81a69aefe fs: fix createReadStream(…, {end: n}) for non-seekable fds
82bdf8fba2 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 82bdf8fba2 fixed,
and align behaviour with the native file stream mechanism
introduced in https://github.com/nodejs/node/pull/18936 as well.

Backport-PR-URL: https://github.com/nodejs/node/pull/19411
PR-URL: https://github.com/nodejs/node/pull/19329
Fixes: https://github.com/nodejs/node/issues/19240
Refs: https://github.com/nodejs/node/pull/18121
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Chen Gang <gangc.cxy@foxmail.com>
2018-03-29 23:25:34 -04:00
..
2015-10-08 17:32:08 -07:00
2017-10-25 04:09:42 -04:00
2017-09-05 12:49:49 -04:00
2016-12-20 14:42:45 -05:00
2018-02-12 19:28:06 -05:00
2018-02-12 19:28:05 -05:00
2017-09-05 12:49:50 -04:00
2018-02-27 00:01:59 -05:00
2017-03-08 17:11:23 -08:00
2016-10-11 12:31:51 -04:00
2018-02-12 19:28:11 -05:00
2018-02-12 19:28:04 -05:00
2017-11-28 13:10:35 +09:00
2017-12-13 15:53:34 +00:00
2018-02-12 19:28:11 -05:00
2018-02-12 19:28:11 -05:00
2017-03-08 17:10:34 -08:00