xcwxcwxc
All checks were successful
Rust Checks / checks (push) Successful in 1m8s
Rust Checks / checks (pull_request) Successful in 1m7s

This commit is contained in:
Tipragot 2024-02-12 23:33:43 +01:00
parent 03bbf4897f
commit f76becc2eb

View file

@ -149,7 +149,7 @@ impl Connection {
self.send_sender.send(Message::Binary(data)).ok();
}
/// Receive a message from the target client.
/// Receive a message from the relay connection.
pub fn read(&self) -> Option<(Uuid, Vec<u8>)> {
self.receive_receiver.try_recv().ok()
}
@ -208,7 +208,7 @@ impl Connection {
/// Start the websocket handshake.
fn start_handshake(&mut self, stream: TcpStream) -> ConnectionState {
match tungstenite::client_tls(format!("wss://{}", self.domain), stream) {
Ok((socket, _)) => ConnectionState::Active(socket),
Ok((socket, _)) => ConnectionState::Handshaked(socket),
Err(HandshakeError::Interrupted(handshake)) => ConnectionState::Handshaking(handshake),
Err(HandshakeError::Failure(e)) => {
warn!("handshake failed with the relay server: {e}");