diff options
author | Wez Furlong <wez@wezfurlong.org> | 2019-10-20 09:17:56 +0100 |
---|---|---|
committer | Wez Furlong <wez@wezfurlong.org> | 2019-10-20 09:36:31 +0100 |
commit | 5aa582132909a9159b810ec175b039900862fb39 (patch) | |
tree | 1bd211ea526cc77e4e28b3cc3f968c47ec7ec384 /src/agent.rs | |
parent | 7f6623e981f19016541ef4e451c46c39fd9684b2 (diff) | |
download | ssh2-rs-5aa582132909a9159b810ec175b039900862fb39.zip |
Make Session be `Send` again
Refs: https://github.com/alexcrichton/ssh2-rs/issues/137
Diffstat (limited to 'src/agent.rs')
-rw-r--r-- | src/agent.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/agent.rs b/src/agent.rs index 88c84f5..5eb5bc4 100644 --- a/src/agent.rs +++ b/src/agent.rs @@ -1,8 +1,8 @@ use std::ffi::CString; use std::marker; -use std::rc::Rc; use std::slice; use std::str; +use std::sync::Arc; use util::Binding; use {raw, Error, SessionInner}; @@ -12,7 +12,7 @@ use {raw, Error, SessionInner}; /// Agents can be used to authenticate a session. pub struct Agent { raw: *mut raw::LIBSSH2_AGENT, - sess: Rc<SessionInner>, + sess: Arc<SessionInner>, } /// An iterator over the identities found in an SSH agent. @@ -30,14 +30,14 @@ pub struct PublicKey<'agent> { impl Agent { pub(crate) fn from_raw_opt( raw: *mut raw::LIBSSH2_AGENT, - sess: &Rc<SessionInner>, + sess: &Arc<SessionInner>, ) -> Result<Self, Error> { if raw.is_null() { Err(Error::last_error_raw(sess.raw).unwrap_or_else(Error::unknown)) } else { Ok(Self { raw, - sess: Rc::clone(sess), + sess: Arc::clone(sess), }) } } |