File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -12,9 +12,7 @@ use tracing::{debug, warn};
1212mod key_exchange;
1313use key_exchange:: KeyExchange ;
1414mod proto;
15- use proto:: { DecryptingReader , EncryptingWriter } ;
16-
17- use crate :: proto:: Packet ;
15+ use proto:: { DecryptingReader , Encode , EncryptingWriter , Packet } ;
1816
1917/// A single SSH connection
2018pub struct Connection {
@@ -62,7 +60,7 @@ impl Connection {
6260 todo ! ( ) ;
6361 }
6462
65- pub async fn connect (
63+ pub ( crate ) async fn connect (
6664 stream : TcpStream ,
6765 addr : SocketAddr ,
6866 host_key : Arc < Ed25519KeyPair > ,
@@ -71,12 +69,12 @@ impl Connection {
7169 todo ! ( )
7270 }
7371
74- pub async fn recv_packet ( & mut self ) -> anyhow:: Result < Packet < ' _ > > {
75- todo ! ( )
72+ pub ( crate ) async fn recv_packet ( & mut self ) -> anyhow:: Result < Packet < ' _ > > {
73+ Ok ( self . stream_read . read_packet ( ) . await ? )
7674 }
7775
78- pub async fn send_packet ( & mut self , packet : impl Encode ) -> anyhow:: Result < ( ) > {
79- todo ! ( )
76+ pub ( crate ) async fn send_packet ( & mut self , payload : & impl Encode ) -> anyhow:: Result < ( ) > {
77+ Ok ( self . stream_write . write_packet ( payload , |_| { } ) . await ? )
8078 }
8179}
8280
You can’t perform that action at this time.
0 commit comments