Skip to content
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

Implement Sftp::from_clonable_session* #131

Merged
merged 1 commit into from
Jul 11, 2024
Merged

Implement Sftp::from_clonable_session* #131

merged 1 commit into from
Jul 11, 2024

Conversation

NobodyXu
Copy link
Member

Fixed #130

Fixed #130

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
@NobodyXu
Copy link
Member Author

NobodyXu commented Jul 10, 2024

cc @kanpov can you have a try of this PR please?

It should provide an ergonomic API for you without having to open multiple ssh sessions.

@kanpov
Copy link

kanpov commented Jul 11, 2024

@NobodyXu the trait bound: openssh::Session: Deref is not satisfied

@NobodyXu
Copy link
Member Author

NobodyXu commented Jul 11, 2024

cc @kanpov It's design to work with Arc<Session> (or any reference counted container) so that you can reuse the session elsewhere.

@kanpov
Copy link

kanpov commented Jul 11, 2024

@NobodyXu By creating an arc of the session, and cloning the arc and passing the clone into from_cloneable_session, everything works

@NobodyXu NobodyXu added this pull request to the merge queue Jul 11, 2024
Merged via the queue into main with commit bef9b21 Jul 11, 2024
6 checks passed
@NobodyXu NobodyXu deleted the openssh-session branch July 11, 2024 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Trying to create a file over SFTP results in BackgroundTaskFailure
2 participants