mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
aquatic_ws: use log crate for debug error messages
This commit is contained in:
parent
572aa632b6
commit
0f6d6d4b21
5 changed files with 12 additions and 10 deletions
|
|
@ -21,6 +21,7 @@ either = "1"
|
|||
flume = "0.7"
|
||||
hashbrown = { version = "0.7", features = ["serde"] }
|
||||
indexmap = "1"
|
||||
log = "0.4"
|
||||
mimalloc = { version = "0.1", default-features = false }
|
||||
mio = { version = "0.7", features = ["tcp", "os-poll", "os-util"] }
|
||||
native-tls = "0.2"
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ use std::io::{Read, Write};
|
|||
|
||||
use either::Either;
|
||||
use hashbrown::HashMap;
|
||||
use log::info;
|
||||
use mio::Token;
|
||||
use mio::net::TcpStream;
|
||||
use native_tls::{TlsAcceptor, TlsStream, MidHandshakeTlsStream};
|
||||
|
|
@ -145,7 +146,7 @@ impl HandshakeMachine {
|
|||
(Some(Either::Right(Self::TlsMidHandshake(handshake))), true)
|
||||
},
|
||||
Err(native_tls::HandshakeError::Failure(err)) => {
|
||||
eprintln!("tls handshake error: {}", err);
|
||||
info!("tls handshake error: {}", err);
|
||||
|
||||
(None, false)
|
||||
}
|
||||
|
|
@ -171,7 +172,7 @@ impl HandshakeMachine {
|
|||
(Some(Either::Right(HandshakeMachine::WsMidHandshake(handshake))), true)
|
||||
},
|
||||
Err(HandshakeError::Failure(err)) => {
|
||||
eprintln!("ws handshake error: {}", err);
|
||||
info!("ws handshake error: {}", err);
|
||||
|
||||
(None, false)
|
||||
}
|
||||
|
|
@ -243,7 +244,7 @@ impl Connection {
|
|||
|
||||
// Required after ws.close()
|
||||
if let Err(err) = ews.ws.write_pending(){
|
||||
eprintln!(
|
||||
info!(
|
||||
"error writing pending messages after closing ws: {}",
|
||||
err
|
||||
)
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ use std::time::Duration;
|
|||
use std::io::ErrorKind;
|
||||
|
||||
use hashbrown::HashMap;
|
||||
use log::info;
|
||||
use native_tls::TlsAcceptor;
|
||||
|
||||
use mio::{Events, Poll, Interest, Token};
|
||||
use mio::net::TcpListener;
|
||||
|
||||
|
|
@ -145,7 +145,7 @@ fn accept_new_streams(
|
|||
break
|
||||
}
|
||||
|
||||
eprint!("error while accepting streams: {}", err);
|
||||
info!("error while accepting streams: {}", err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -189,7 +189,7 @@ pub fn run_handshakes_and_read_messages(
|
|||
break
|
||||
},
|
||||
Err(err) => {
|
||||
eprintln!("error reading messages: {}", err);
|
||||
info!("error reading messages: {}", err);
|
||||
|
||||
remove_connection_if_exists(connections, poll_token);
|
||||
|
||||
|
|
@ -225,7 +225,7 @@ pub fn send_out_messages(
|
|||
|
||||
if let Some(established_ws) = opt_established_ws {
|
||||
if established_ws.peer_addr != meta.peer_addr {
|
||||
eprintln!("socket worker error: peer socket addrs didn't match");
|
||||
info!("socket worker error: peer socket addrs didn't match");
|
||||
|
||||
continue;
|
||||
}
|
||||
|
|
@ -239,7 +239,7 @@ pub fn send_out_messages(
|
|||
remove_connection_if_exists(connections, meta.poll_token);
|
||||
},
|
||||
Err(err) => {
|
||||
eprintln!("error writing ws message: {}", err);
|
||||
info!("error writing ws message: {}", err);
|
||||
|
||||
remove_connection_if_exists(
|
||||
connections,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue