mirror of https://github.com/telemt/telemt.git
Merge remote-tracking branch 'upstream/main'
This commit is contained in:
commit
2c7720d075
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "telemt"
|
||||
version = "3.0.6"
|
||||
version = "3.0.8"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
|
|
|
|||
38
src/main.rs
38
src/main.rs
|
|
@ -940,7 +940,43 @@ match crate::transport::middle_proxy::fetch_proxy_secret(proxy_secret_path).awai
|
|||
.run()
|
||||
.await
|
||||
{
|
||||
warn!(peer = %peer_addr, error = %e, "Connection closed with error");
|
||||
let peer_closed = match &e {
|
||||
crate::error::ProxyError::Io(ioe) => {
|
||||
matches!(
|
||||
ioe.kind(),
|
||||
std::io::ErrorKind::ConnectionReset
|
||||
| std::io::ErrorKind::ConnectionAborted
|
||||
| std::io::ErrorKind::BrokenPipe
|
||||
| std::io::ErrorKind::NotConnected
|
||||
)
|
||||
}
|
||||
crate::error::ProxyError::Stream(
|
||||
crate::error::StreamError::Io(ioe),
|
||||
) => {
|
||||
matches!(
|
||||
ioe.kind(),
|
||||
std::io::ErrorKind::ConnectionReset
|
||||
| std::io::ErrorKind::ConnectionAborted
|
||||
| std::io::ErrorKind::BrokenPipe
|
||||
| std::io::ErrorKind::NotConnected
|
||||
)
|
||||
}
|
||||
_ => false,
|
||||
};
|
||||
|
||||
if peer_closed {
|
||||
debug!(
|
||||
peer = %peer_addr,
|
||||
error = %e,
|
||||
"Connection closed by peer"
|
||||
);
|
||||
} else {
|
||||
warn!(
|
||||
peer = %peer_addr,
|
||||
error = %e,
|
||||
"Connection closed with error"
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue