chanmgr: trace-level logs when launching connections.
Based on more temporary debugging code. Yet another part of #677.
This commit is contained in:
parent
71dfaa3125
commit
1e25a962a7
|
@ -9,6 +9,7 @@ use safelog::sensitive as sv;
|
|||
use tor_error::bad_api_usage;
|
||||
use tor_linkspec::{ChannelMethod, HasChanMethod, OwnedChanTarget};
|
||||
use tor_rtcompat::{Runtime, TcpProvider};
|
||||
use tracing::trace;
|
||||
|
||||
use crate::Error;
|
||||
|
||||
|
@ -50,6 +51,8 @@ impl<R: Runtime> crate::transport::TransportImplHelper for DefaultTransport<R> {
|
|||
}
|
||||
};
|
||||
|
||||
trace!("Launching direct connection for {}", target);
|
||||
|
||||
let (stream, addr) = connect_to_one(&self.runtime, &direct_addrs).await?;
|
||||
let mut using_target = target.clone();
|
||||
let _ignore = using_target.chan_method_mut().retain_addrs(|a| a == &addr);
|
||||
|
|
|
@ -26,6 +26,7 @@ use tor_rtcompat::TcpProvider;
|
|||
use tor_socksproto::{
|
||||
SocksAddr, SocksAuth, SocksClientHandshake, SocksCmd, SocksRequest, SocksStatus, SocksVersion,
|
||||
};
|
||||
use tracing::trace;
|
||||
|
||||
#[cfg(feature = "pt-client")]
|
||||
use super::TransportImplHelper;
|
||||
|
@ -69,6 +70,12 @@ pub(crate) async fn connect_via_proxy<R: TcpProvider + Send + Sync>(
|
|||
protocol: &Protocol,
|
||||
target: &PtTargetAddr,
|
||||
) -> Result<R::TcpStream, ProxyError> {
|
||||
trace!(
|
||||
"Launching a proxied connection to {} via proxy at {} using {:?}",
|
||||
target,
|
||||
proxy,
|
||||
protocol
|
||||
);
|
||||
let mut stream = runtime
|
||||
.connect(proxy)
|
||||
.await
|
||||
|
@ -147,6 +154,11 @@ pub(crate) async fn connect_via_proxy<R: TcpProvider + Send + Sync>(
|
|||
let status = reply
|
||||
.ok_or_else(|| internal!("SOCKS protocol finished, but gave no status!"))?
|
||||
.status();
|
||||
trace!(
|
||||
"SOCKS handshake with {} succeeded, with status {:?}",
|
||||
proxy,
|
||||
status
|
||||
);
|
||||
|
||||
if status != SocksStatus::SUCCEEDED {
|
||||
return Err(ProxyError::SocksError(status));
|
||||
|
|
Loading…
Reference in New Issue