(filename, options, callback, res)
| 18858 | } |
| 18859 | |
| 18860 | function fsStreamRead(filename, options, callback, res) { |
| 18861 | |
| 18862 | if (!callback) { |
| 18863 | callback = options; |
| 18864 | options = undefined; |
| 18865 | } |
| 18866 | |
| 18867 | var opt; |
| 18868 | |
| 18869 | if (options) { |
| 18870 | |
| 18871 | opt = HEADERS.fsStreamReadRange; |
| 18872 | opt.start = options.start; |
| 18873 | opt.end = options.end; |
| 18874 | |
| 18875 | if (opt.start > opt.end) |
| 18876 | delete opt.end; |
| 18877 | |
| 18878 | } else |
| 18879 | opt = HEADERS.fsStreamRead; |
| 18880 | |
| 18881 | U.queue('F.files', CONF.default_maxopenfiles, function(next) { |
| 18882 | var stream = Fs.createReadStream(filename, opt); |
| 18883 | stream.on('error', NOOP); |
| 18884 | callback(stream, next, res); |
| 18885 | }, filename); |
| 18886 | } |
| 18887 | |
| 18888 | /** |
| 18889 | * Prepare URL address to temporary key (for caching) |
no test coverage detected