tor-chanmgr: don't log addresses so much.

We now log connection attempts at debug!, and mark relay target
addresses as sensitive.
This commit is contained in:
Nick Mathewson 2022-08-25 10:54:50 -04:00
parent 709543bb48
commit 920f7a3f53
3 changed files with 6 additions and 3 deletions

1
Cargo.lock generated
View File

@ -3476,6 +3476,7 @@ dependencies = [
"itertools", "itertools",
"postage", "postage",
"rand 0.8.5", "rand 0.8.5",
"safelog",
"serde", "serde",
"thiserror", "thiserror",
"tor-basic-utils", "tor-basic-utils",

View File

@ -12,7 +12,7 @@ categories = ["network-programming", "cryptography"]
repository = "https://gitlab.torproject.org/tpo/core/arti.git/" repository = "https://gitlab.torproject.org/tpo/core/arti.git/"
[features] [features]
testing = [ ] testing = []
[dependencies] [dependencies]
async-trait = "0.1.2" async-trait = "0.1.2"
@ -22,6 +22,7 @@ educe = "0.4.6"
futures = "0.3.14" futures = "0.3.14"
postage = { version = "0.5.0", default-features = false, features = ["futures-traits"] } postage = { version = "0.5.0", default-features = false, features = ["futures-traits"] }
rand = "0.8" rand = "0.8"
safelog = { path = "../safelog", version = "0.1.2" }
serde = { version = "1.0.103", features = ["derive"] } serde = { version = "1.0.103", features = ["derive"] }
thiserror = "1" thiserror = "1"
tor-basic-utils = { path = "../tor-basic-utils", version = "0.3.3" } tor-basic-utils = { path = "../tor-basic-utils", version = "0.3.3" }

View File

@ -6,6 +6,7 @@ use std::sync::{Arc, Mutex};
use crate::{event::ChanMgrEventSender, Error}; use crate::{event::ChanMgrEventSender, Error};
use safelog::sensitive as sv;
use std::time::Duration; use std::time::Duration;
use tor_error::{bad_api_usage, internal}; use tor_error::{bad_api_usage, internal};
use tor_linkspec::{HasAddrs, HasRelayIds, OwnedChanTarget}; use tor_linkspec::{HasAddrs, HasRelayIds, OwnedChanTarget};
@ -94,7 +95,7 @@ async fn connect_to_one<R: Runtime>(
.map(|(i, a)| { .map(|(i, a)| {
let delay = rt.sleep(CONNECTION_DELAY * i as u32); let delay = rt.sleep(CONNECTION_DELAY * i as u32);
delay.then(move |_| { delay.then(move |_| {
tracing::info!("Connecting to {}", a); tracing::debug!("Connecting to {}", a);
rt.connect(a) rt.connect(a)
.map_ok(move |stream| (stream, *a)) .map_ok(move |stream| (stream, *a))
.map_err(move |e| (e, *a)) .map_err(move |e| (e, *a))
@ -115,7 +116,7 @@ async fn connect_to_one<R: Runtime>(
Err((e, a)) => { Err((e, a)) => {
// We got a failure on one of the streams. Store the error. // We got a failure on one of the streams. Store the error.
// TODO(eta): ideally we'd start the next connection attempt immediately. // TODO(eta): ideally we'd start the next connection attempt immediately.
tracing::warn!("Connection to {} failed: {}", a, e); tracing::warn!("Connection to {} failed: {}", sv(a), e);
errors.push((e, a)); errors.push((e, a));
} }
} }