summaryrefslogtreecommitdiff
path: root/src/listener.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-01-17 15:23:18 -0800
committerAlex Crichton <alex@alexcrichton.com>2015-01-17 15:23:18 -0800
commite2b22f1665ecfb776e17ced93473cf5695ed00d4 (patch)
treed43a5b3dca2f6adc8507ad79a33df8c4a215f8a9 /src/listener.rs
parentea6e306c68450a88024bbc615361144297703ed0 (diff)
downloadssh2-rs-e2b22f1665ecfb776e17ced93473cf5695ed00d4.zip
Update to rust master
Diffstat (limited to 'src/listener.rs')
-rw-r--r--src/listener.rs14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/listener.rs b/src/listener.rs
index ab88abe..6ea3ad8 100644
--- a/src/listener.rs
+++ b/src/listener.rs
@@ -1,18 +1,15 @@
-use std::marker;
-
use {raw, Session, Error, Channel};
/// A listener represents a forwarding port from the remote server.
///
/// New channels can be accepted from a listener which represent connections on
/// the remote server's port.
-pub struct Listener<'a> {
+pub struct Listener<'sess> {
raw: *mut raw::LIBSSH2_LISTENER,
- sess: &'a Session,
- marker: marker::NoSync,
+ sess: &'sess Session,
}
-impl<'a> Listener<'a> {
+impl<'sess> Listener<'sess> {
/// Wraps a raw pointer in a new Listener structure tied to the lifetime of the
/// given session.
///
@@ -22,12 +19,11 @@ impl<'a> Listener<'a> {
Listener {
raw: raw,
sess: sess,
- marker: marker::NoSync,
}
}
/// Accept a queued connection from this listener.
- pub fn accept(&mut self) -> Result<Channel<'a>, Error> {
+ pub fn accept(&mut self) -> Result<Channel<'sess>, Error> {
unsafe {
let ret = raw::libssh2_channel_forward_accept(self.raw);
if ret.is_null() {
@@ -40,7 +36,7 @@ impl<'a> Listener<'a> {
}
#[unsafe_destructor]
-impl<'a> Drop for Listener<'a> {
+impl<'sess> Drop for Listener<'sess> {
fn drop(&mut self) {
unsafe { assert_eq!(raw::libssh2_channel_forward_cancel(self.raw), 0) }
}