ME Connection lost fixes

This commit is contained in:
Alexey 2026-02-21 16:12:19 +03:00
parent 1be4422431
commit 06d2cdef78
No known key found for this signature in database
1 changed files with 19 additions and 22 deletions

View File

@ -940,42 +940,39 @@ match crate::transport::middle_proxy::fetch_proxy_secret(proxy_secret_path).awai
.run() .run()
.await .await
{ {
let peer_closed = match &e { let peer_closed = matches!(
crate::error::ProxyError::Io(ioe) => { &e,
matches!( crate::error::ProxyError::Io(ioe)
if matches!(
ioe.kind(), ioe.kind(),
std::io::ErrorKind::ConnectionReset std::io::ErrorKind::ConnectionReset
| std::io::ErrorKind::ConnectionAborted | std::io::ErrorKind::ConnectionAborted
| std::io::ErrorKind::BrokenPipe | std::io::ErrorKind::BrokenPipe
| std::io::ErrorKind::NotConnected | std::io::ErrorKind::NotConnected
) )
} ) || matches!(
&e,
crate::error::ProxyError::Stream( crate::error::ProxyError::Stream(
crate::error::StreamError::Io(ioe), crate::error::StreamError::Io(ioe)
) => { )
matches!( if matches!(
ioe.kind(), ioe.kind(),
std::io::ErrorKind::ConnectionReset std::io::ErrorKind::ConnectionReset
| std::io::ErrorKind::ConnectionAborted | std::io::ErrorKind::ConnectionAborted
| std::io::ErrorKind::BrokenPipe | std::io::ErrorKind::BrokenPipe
| std::io::ErrorKind::NotConnected | std::io::ErrorKind::NotConnected
) )
} );
_ => false,
};
if peer_closed { let me_closed = matches!(
debug!( &e,
peer = %peer_addr, crate::error::ProxyError::Proxy(msg) if msg == "ME connection lost"
error = %e, );
"Connection closed by peer"
); match (peer_closed, me_closed) {
} else { (true, _) => debug!(peer = %peer_addr, error = %e, "Connection closed by client"),
warn!( (_, true) => warn!(peer = %peer_addr, error = %e, "Connection closed: Middle-End dropped session"),
peer = %peer_addr, _ => warn!(peer = %peer_addr, error = %e, "Connection closed with error"),
error = %e,
"Connection closed with error"
);
} }
} }
}); });