Skip to content

Commit 0047d28

Browse files
committed
expose ssh_send_ignore
refs: wezterm/wezterm#4023
1 parent ec94029 commit 0047d28

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

libssh-rs/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "libssh-rs"
3-
version = "0.3.5"
3+
version = "0.3.6"
44
edition = "2018"
55
repository = "https://github.com/wez/libssh-rs"
66
description = "Bindings to the libssh library"

libssh-rs/src/lib.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,6 +1169,21 @@ impl Session {
11691169
sftp.init()?;
11701170
Ok(sftp)
11711171
}
1172+
1173+
/// Send a message that should be ignored by the peer
1174+
pub fn send_ignore(&self, data: &[u8]) -> SshResult<()> {
1175+
let sess = self.lock_session();
1176+
let status = unsafe { sys::ssh_send_ignore(**sess, data.as_ptr() as _) };
1177+
if status != sys::SSH_OK as i32 {
1178+
if let Some(err) = sess.last_error() {
1179+
Err(err)
1180+
} else {
1181+
Err(Error::TryAgain)
1182+
}
1183+
} else {
1184+
Ok(())
1185+
}
1186+
}
11721187
}
11731188

11741189
#[cfg(unix)]

0 commit comments

Comments
 (0)