-
Notifications
You must be signed in to change notification settings - Fork 721
Fix transfer only partially transferring #3902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3902 +/- ##
==========================================
- Coverage 89.11% 89.11% -0.01%
==========================================
Files 255 255
Lines 14600 14602 +2
==========================================
+ Hits 13011 13012 +1
- Misses 1589 1590 +1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good on my end! Tested with the ingredients.tar.gz in the linked issue and they had the same md5sum after transferring
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @Sploder12, good work. A couple of matters for discussion inline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, this looks good to me.
I tried transfers with different files, with random data, and they all worked. Unfortunately that's not worth much, because the same is true on the edge channel (i.e. I could not reproduce the original issue). Two other devs have verified the fix though, and the new code makes sense, so approving.
@@ -77,10 +77,19 @@ struct SFTPClient : public testing::Test | |||
return {std::make_unique<mp::SSHSession>("b", 43, "ubuntu", key_provider)}; | |||
} | |||
|
|||
// this is a macro since REPLACE only applies to the current scope and cannot be moved out. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh you need the capture so extracting the lambda wouldn't work. You'd need std::bind
or another lambda again. Alright.
Fixes the issue of
multipass transfer
only transferring some chunks of the file. This usessftp_limits
instead of the constant65536u
to determine the correct buffer size for SFTP reads and writes.Fixes #3892
MULTI-1768