tor-hsclient: Add some more debugging

This commit is contained in:
Ian Jackson 2023-06-13 15:33:37 +01:00
parent e123ade035
commit bfaf0bba6f
1 changed files with 39 additions and 2 deletions

View File

@ -897,6 +897,13 @@ impl<'c, R: Runtime, M: MocksForConnect<R>> Context<'c, R, M> {
let (intro_ack_tx, intro_ack_rx) = proto_oneshot::channel(); let (intro_ack_tx, intro_ack_rx) = proto_oneshot::channel();
let handler = Handler { intro_ack_tx }; let handler = Handler { intro_ack_tx };
debug!(
"hs conn to {}: RPT {} IPT {}: making introduction - sending INTRODUCE1",
&self.hsid,
rend_pt.as_inner(),
intro_index,
);
intro_circ intro_circ
.send_control_message(intro1_real.into(), handler) .send_control_message(intro1_real.into(), handler)
.await .await
@ -913,6 +920,13 @@ impl<'c, R: Runtime, M: MocksForConnect<R>> Context<'c, R, M> {
intro_index, intro_index,
})?; })?;
debug!(
"hs conn to {}: RPT {} IPT {}: making introduction - success",
&self.hsid,
rend_pt.as_inner(),
intro_index,
);
Ok(( Ok((
rendezvous, rendezvous,
Introduced { Introduced {
@ -942,14 +956,30 @@ impl<'c, R: Runtime, M: MocksForConnect<R>> Context<'c, R, M> {
#![allow(unreachable_code, clippy::diverging_sub_expression)] // TODO HS remove. #![allow(unreachable_code, clippy::diverging_sub_expression)] // TODO HS remove.
use tor_proto::circuit::handshake; use tor_proto::circuit::handshake;
let rend_pt = rend_pt_identity_for_error(&rendezvous.rend_relay);
let intro_index = ipt.intro_index;
let handle_proto_error = |error| FAE::RendezvousCompletion { let handle_proto_error = |error| FAE::RendezvousCompletion {
error, error,
intro_index: ipt.intro_index, intro_index,
rend_pt: rend_pt_identity_for_error(&rendezvous.rend_relay), rend_pt: rend_pt.clone(),
}; };
debug!(
"hs conn to {}: RPT {} IPT {}: awaiting rendezvous completion",
&self.hsid,
rend_pt.as_inner(),
intro_index,
);
let rend2_msg: Rendezvous2 = rendezvous.rend2_rx.recv(handle_proto_error).await?; let rend2_msg: Rendezvous2 = rendezvous.rend2_rx.recv(handle_proto_error).await?;
debug!(
"hs conn to {}: RPT {} IPT {}: received RENDEZVOUS2",
&self.hsid,
rend_pt.as_inner(),
intro_index,
);
// TODO: It would be great if we could have multiple of these existing // TODO: It would be great if we could have multiple of these existing
// in parallel with similar x,X values but different ipts. I believe C // in parallel with similar x,X values but different ipts. I believe C
// tor manages it somehow. // tor manages it somehow.
@ -981,6 +1011,13 @@ impl<'c, R: Runtime, M: MocksForConnect<R>> Context<'c, R, M> {
"actually this is probably a 'circuit closed' error" // TODO HS "actually this is probably a 'circuit closed' error" // TODO HS
))?; ))?;
debug!(
"hs conn to {}: RPT {} IPT {}: HS circuit established",
&self.hsid,
rend_pt.as_inner(),
intro_index,
);
Ok(rendezvous.rend_circ) Ok(rendezvous.rend_circ)
} }
} }