File tree Expand file tree Collapse file tree 3 files changed +3
-18
lines changed Expand file tree Collapse file tree 3 files changed +3
-18
lines changed Original file line number Diff line number Diff line change @@ -473,7 +473,7 @@ mod test_compress {
473473
474474 use async_trait:: async_trait;
475475 use log:: debug;
476-
476+
477477 use super :: server:: { Server as _, Session } ;
478478 use super :: * ;
479479 use crate :: server:: Msg ;
@@ -826,7 +826,7 @@ mod test_channels {
826826 test_session (
827827 Client { } ,
828828 sh,
829- |mut client| async move {
829+ |client| async move {
830830 let ch = client. channel_open_session ( ) . await . unwrap ( ) ;
831831 let mut stream = ch. into_stream ( ) ;
832832 stream. write_all ( & b"request" [ ..] ) . await . unwrap ( ) ;
@@ -918,7 +918,7 @@ mod test_channels {
918918 test_session (
919919 Client { } ,
920920 sh,
921- |mut c| async move {
921+ |c| async move {
922922 let mut ch = c. channel_open_session ( ) . await . unwrap ( ) ;
923923 ch. data ( & b"hello world!" [ ..] ) . await . unwrap ( ) ;
924924
Original file line number Diff line number Diff line change @@ -803,7 +803,6 @@ where
803803 let common = read_ssh_id ( config, & mut stream) . await ?;
804804 let handle = server:: session:: Handle { sender } ;
805805 let session = Session {
806- session_id : get_session_id ( ) ,
807806 target_window_size : common. config . window_size ,
808807 common,
809808 receiver,
Original file line number Diff line number Diff line change 11use std:: collections:: HashMap ;
2- use std:: sync:: atomic:: { AtomicUsize , Ordering } ;
32use std:: sync:: Arc ;
43
54use russh_keys:: encoding:: Encoding ;
@@ -11,15 +10,8 @@ use super::*;
1110use crate :: channels:: { Channel , ChannelMsg } ;
1211use crate :: msg;
1312
14- static SESSION_COUNTER : AtomicUsize = AtomicUsize :: new ( 0 ) ;
15-
16- pub ( crate ) fn get_session_id ( ) -> usize {
17- SESSION_COUNTER . fetch_add ( 1 , Ordering :: SeqCst )
18- }
19-
2013/// A connected server session. This type is unique to a client.
2114pub struct Session {
22- pub ( crate ) session_id : usize ,
2315 pub ( crate ) common : CommonSession < Arc < Config > > ,
2416 pub ( crate ) sender : Handle ,
2517 pub ( crate ) receiver : Receiver < Msg > ,
@@ -481,12 +473,6 @@ impl Session {
481473 Ok ( ( ) )
482474 }
483475
484- /// Application-unqiue session ID. Can be used for identifying the session
485- /// across method calls.
486- pub fn id ( & self ) -> usize {
487- self . session_id
488- }
489-
490476 /// Get a handle to this session.
491477 pub fn handle ( & self ) -> Handle {
492478 self . sender . clone ( )
You can’t perform that action at this time.
0 commit comments