Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ openssl = []
[dependencies]
russh = { version = "0.55.0", default-features = false, features = ["rsa", "flate2", "ring"] }
log = "0.4"
russh-sftp = "2.1.1"
russh-sftp = "2.1.2"
thiserror = "2.0.17"
tokio = { version = "1.45.1", features = ["fs"] }

Expand Down
11 changes: 9 additions & 2 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ use russh::{
Channel,
client::{Config, Handle, Handler, Msg},
};
use russh_sftp::{client::SftpSession, protocol::OpenFlags};
use russh_sftp::{
client::{Config as SftpConfig, SftpSession},
protocol::OpenFlags,
};
use std::net::SocketAddr;
use std::sync::Arc;
use std::time::Instant;
Expand Down Expand Up @@ -533,7 +536,11 @@ impl Client {
// start sftp session
let channel = self.get_channel().await?;
channel.request_subsystem(true, "sftp").await?;
let sftp = SftpSession::new_opts(channel.into_stream(), timeout_seconds).await?;
let mut sftp_config = SftpConfig::default();
if let Some(timeout_seconds) = timeout_seconds {
sftp_config.request_timeout_secs = timeout_seconds;
}
let sftp = SftpSession::new_with_config(channel.into_stream(), sftp_config).await?;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Bump the russh-sftp requirement with the new API

This call now requires the russh-sftp 2.3 API, but Cargo.toml still declares russh-sftp = "2.1.1" (Cargo.toml:21). In workspaces or downstream builds whose lockfile already contains russh-sftp 2.1.x, Cargo is allowed to keep that version, where SftpSession only has new/new_opts and no new_with_config, so updating this crate can fail to compile until the transitive dependency is manually updated. Please raise the dependency floor to the first version that provides new_with_config.

Useful? React with 👍 / 👎.


let file_size = tokio::fs::metadata(&src_file_path).await?.len();
// read file contents locally
Expand Down
Loading