log::info adjustment

This commit is contained in:
ssrlive 2023-09-02 17:36:30 +08:00
parent e5a645638a
commit 5bd62d3101
2 changed files with 10 additions and 10 deletions

View file

@ -142,7 +142,7 @@ impl SocksProxyImpl {
let response = handshake::Response::retrieve_from_stream(&mut self.server_inbuf.clone());
if let Err(e) = &response {
if e.kind() == std::io::ErrorKind::UnexpectedEof {
// log::trace!("receive_server_hello_socks5 needs more data \"{}\"...", e);
log::trace!("receive_server_hello_socks5 needs more data \"{}\"...", e);
return Ok(());
} else {
return Err(e.to_string().into());
@ -217,7 +217,7 @@ impl SocksProxyImpl {
let response = protocol::Response::retrieve_from_stream(&mut self.server_inbuf.clone());
if let Err(e) = &response {
if e.kind() == std::io::ErrorKind::UnexpectedEof {
// log::trace!("receive_connection_status needs more data \"{}\"...", e);
log::trace!("receive_connection_status needs more data \"{}\"...", e);
return Ok(());
} else {
return Err(e.to_string().into());
@ -231,7 +231,7 @@ impl SocksProxyImpl {
if self.command == protocol::Command::UdpAssociate {
self.udp_associate = Some(SocketAddr::try_from(&response.address)?);
assert!(self.data_buf.is_empty());
// log::debug!("UDP associate: {}", response.address);
log::trace!("UDP associate recieved address {}", response.address);
}
self.server_outbuf.append(&mut self.data_buf);

View file

@ -56,8 +56,8 @@ impl ConnectionInfo {
fn to_named(&self, name: String) -> Self {
let mut result = self.clone();
result.dst = Address::from((name, result.dst.port()));
// let p = self.protocol;
// log::trace!("{p} replace dst \"{}\" -> \"{}\"", self.dst, result.dst);
let p = self.protocol;
log::trace!("{p} replace dst \"{}\" -> \"{}\"", self.dst, result.dst);
result
}
}
@ -705,7 +705,7 @@ impl<'a> TunToProxy<'a> {
let mut handler = || -> Result<(), Error> {
let result = connection_tuple(frame);
if let Err(error) = result {
log::info!("{}, ignored", error);
log::debug!("{}, ignored", error);
return Ok(());
}
let (info, _first_packet, payload_offset, payload_size) = result?;
@ -723,10 +723,10 @@ impl<'a> TunToProxy<'a> {
log::info!("Connect done {} ({})", info, origin_dst);
} else if !self.connection_map.contains_key(&info) {
// log::debug!("Drop middle session {} ({})", info, origin_dst);
log::trace!("Drop middle session {} ({})", info, origin_dst);
return Ok(());
} else {
// log::trace!("Subsequent packet {} ({})", info, origin_dst);
log::trace!("Subsequent packet {} ({})", info, origin_dst);
}
// Inject the packet to advance the remote proxy server smoltcp socket state
@ -940,8 +940,8 @@ impl<'a> TunToProxy<'a> {
if let Some(connection) = self.find_info_by_token(token) {
let connection = connection.clone();
if let Err(error) = self.write_to_client(token, &connection) {
log::error!("Write to client {}", error);
self.remove_connection(&connection)?;
log::error!("Write to client: {}: ", error);
}
}
}
@ -1112,7 +1112,7 @@ impl<'a> TunToProxy<'a> {
loop {
if let Err(err) = self.poll.poll(&mut events, None) {
if err.kind() == std::io::ErrorKind::Interrupted {
log::warn!("Poll interrupted: \"{err}\", ignored, continue polling");
log::debug!("Poll interrupted: \"{err}\", ignored, continue polling");
continue;
}
return Err(err.into());