tor-hsclient: Check RENDEZVOUS_ESTABLISHED *after* it should exist

Bugfix, without which this code wouldn't work.

Reported in
  https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1228#note_2910293
This commit is contained in:
Ian Jackson 2023-06-09 12:16:50 +01:00
parent 180f1dcb47
commit 1fb4c1eb2a
1 changed files with 5 additions and 5 deletions

View File

@ -678,16 +678,16 @@ impl<'c, R: Runtime, M: MocksForConnect<R>> Context<'c, R, M> {
}
}
let _: RendezvousEstablished = reply
.try_recv()
.map_err(into_internal!("oneshot dropped"))?
.ok_or_else(|| internal!("RENDEZVOUS_ESTABLISHED not sent yet"))?;
rend_circ
.send_control_message(message, Handler(Some(reply_tx)))
.await
.map_err(|error| FAE::RendezvousEstablish { error, rend_pt })?;
let _: RendezvousEstablished = reply
.try_recv()
.map_err(into_internal!("oneshot dropped"))?
.ok_or_else(|| internal!("RENDEZVOUS_ESTABLISHED not sent yet"))?;
Ok(Rendezvous {
rend_circ,
rend_cookie,