Skip to content

Commit

Permalink
Try fix sftp read
Browse files Browse the repository at this point in the history
Signed-off-by: Xuanwo <[email protected]>
  • Loading branch information
Xuanwo committed Sep 28, 2024
1 parent c611f34 commit e12a106
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/src/services/sftp/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,8 @@ impl Access for SftpBackend {
.await
.map_err(parse_sftp_error)?;

let meta = f.metadata().await.map_err(parse_sftp_error)?;

if args.range().offset() != 0 {
f.seek(SeekFrom::Start(args.range().offset()))
.await
Expand All @@ -404,7 +406,7 @@ impl Access for SftpBackend {

Ok((
RpRead::default(),
SftpReader::new(client, f, args.range().size()),
SftpReader::new(client, f, args.range().size().and(meta.len())),
))
}

Expand Down

0 comments on commit e12a106

Please sign in to comment.