Commit 54004ca4 authored by Julien Fontanet's avatar Julien Fontanet

chore(createReadStream): use MAX_READ_LENGTH constant

parent 92d558e7
......@@ -2,9 +2,7 @@ var Readable = require('stream').Readable;
var BigInt = require('../tools/bigint');
var request = require('../tools/smb2-forge').request;
// Where does it come from?!
var maxPacketSize = 0x00010000;
var MAX_READ_LENGTH = require('../structures/constants').MAX_READ_LENGTH;
module.exports = function createReadStream(path, options, cb) {
if (typeof options === 'function') {
......@@ -56,7 +54,7 @@ module.exports = function createReadStream(path, options, cb) {
'read',
{
FileId: file.FileId,
Length: Math.min(maxPacketSize, size, end - offset),
Length: Math.min(MAX_READ_LENGTH, size, end - offset),
Offset: new BigInt(8, offset).toBuffer(),
},
connection,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment