summaryrefslogtreecommitdiff
path: root/src/channel.rs
diff options
context:
space:
mode:
authorWez Furlong <wez@wezfurlong.org>2019-10-20 09:17:56 +0100
committerWez Furlong <wez@wezfurlong.org>2019-10-20 09:36:31 +0100
commit5aa582132909a9159b810ec175b039900862fb39 (patch)
tree1bd211ea526cc77e4e28b3cc3f968c47ec7ec384 /src/channel.rs
parent7f6623e981f19016541ef4e451c46c39fd9684b2 (diff)
downloadssh2-rs-5aa582132909a9159b810ec175b039900862fb39.zip
Make Session be `Send` again
Refs: https://github.com/alexcrichton/ssh2-rs/issues/137
Diffstat (limited to 'src/channel.rs')
-rw-r--r--src/channel.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/channel.rs b/src/channel.rs
index 3beece6..679a6c1 100644
--- a/src/channel.rs
+++ b/src/channel.rs
@@ -2,8 +2,8 @@ use libc::{c_char, c_int, c_uchar, c_uint, c_ulong, c_void, size_t};
use std::cmp;
use std::io;
use std::io::prelude::*;
-use std::rc::Rc;
use std::slice;
+use std::sync::Arc;
use {raw, Error, ExtendedData, SessionInner};
@@ -17,21 +17,21 @@ use {raw, Error, ExtendedData, SessionInner};
/// flag on a channel's corresponding `Session`.
pub struct Channel {
raw: *mut raw::LIBSSH2_CHANNEL,
- sess: Rc<SessionInner>,
+ sess: Arc<SessionInner>,
read_limit: Option<u64>,
}
impl Channel {
pub(crate) fn from_raw_opt(
raw: *mut raw::LIBSSH2_CHANNEL,
- 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),
read_limit: None,
})
}