@@ -22,7 +22,6 @@ use crate::connection::JsonRpcConnection;
2222use crate :: connection:: JsonRpcConnectionEvent ;
2323use crate :: connection:: JsonRpcTransport ;
2424use crate :: relay_proto:: RelayData ;
25- use crate :: relay_proto:: RelayHandshake ;
2625use crate :: relay_proto:: RelayMessageFrame ;
2726use crate :: relay_proto:: RelayResume ;
2827use crate :: relay_proto:: relay_message_frame;
@@ -70,18 +69,6 @@ impl RelayMessageFrame {
7069 }
7170 }
7271
73- pub ( crate ) fn handshake ( stream_id : String , payload : Vec < u8 > ) -> Self {
74- Self {
75- version : RELAY_MESSAGE_FRAME_VERSION ,
76- stream_id,
77- ack : 0 ,
78- ack_bits : 0 ,
79- body : Some ( relay_message_frame:: Body :: Handshake ( RelayHandshake {
80- payload,
81- } ) ) ,
82- }
83- }
84-
8572 /// Validate cleartext routing metadata before a frame reaches either the
8673 /// direct JSON-RPC parser or the Noise relay state machine.
8774 ///
@@ -163,21 +150,6 @@ impl RelayMessageFrame {
163150 serde_json:: from_slice ( & payload) . map_err ( ExecServerError :: Json )
164151 }
165152
166- pub ( crate ) fn into_handshake_payload ( self ) -> Result < Vec < u8 > , ExecServerError > {
167- let kind = self . validate ( ) ?;
168- if kind != RelayFrameBodyKind :: Handshake {
169- return Err ( ExecServerError :: Protocol (
170- "expected relay handshake message frame" . to_string ( ) ,
171- ) ) ;
172- }
173- match self . body {
174- Some ( relay_message_frame:: Body :: Handshake ( handshake) ) => Ok ( handshake. payload ) ,
175- _ => Err ( ExecServerError :: Protocol (
176- "expected relay handshake message frame" . to_string ( ) ,
177- ) ) ,
178- }
179- }
180-
181153 pub ( crate ) fn into_reset_reason ( self ) -> Option < String > {
182154 match self . body {
183155 Some ( relay_message_frame:: Body :: Reset ( reset) ) if !reset. reason . is_empty ( ) => {
0 commit comments