Skip to content

Commit

Permalink
fix request start position for chunks larger than 31952 bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffrson committed Apr 24, 2022
1 parent efc0f32 commit 1536f5b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/protocol/SFTP.js
Original file line number Diff line number Diff line change
Expand Up @@ -1986,6 +1986,7 @@ function read_(self, handle, buf, off, len, position, cb, req_) {
const req = (req_ || {
nb: 0,
position,
origPosition: position,
off,
origOff: off,
len: undefined,
Expand All @@ -2012,7 +2013,7 @@ function read_(self, handle, buf, off, len, position, cb, req_) {
data = buf;
else
data = bufferSlice(buf, req.origOff, req.origOff + req.nb + nb);
cb(undefined, req.nb + nb, data, req.position);
cb(undefined, req.nb + nb, data, req.origPosition);
},
buffer: undefined,
});
Expand Down

0 comments on commit 1536f5b

Please sign in to comment.