Skip to content

Commit

Permalink
mark packet_router's shutdown as success before drop (#4491)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonwicky committed Mar 25, 2024
1 parent f5378e8 commit e352c25
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions common/client-libs/gateway-client/src/packet_router.rs
Expand Up @@ -69,6 +69,10 @@ impl PacketRouter {
}
Ok(())
}

pub fn mark_as_success(&mut self) {
self.shutdown.mark_as_success();
}
}

impl GatewayPacketRouter for PacketRouter {
Expand Down
3 changes: 2 additions & 1 deletion common/client-libs/gateway-client/src/socket_state.rs
Expand Up @@ -97,7 +97,7 @@ impl PartiallyDelegated {

pub(crate) fn split_and_listen_for_mixnet_messages(
conn: WsConn,
packet_router: PacketRouter,
mut packet_router: PacketRouter,
shared_key: Arc<SharedKeys>,
mut shutdown: TaskClient,
) -> Self {
Expand Down Expand Up @@ -140,6 +140,7 @@ impl PartiallyDelegated {
if match ret_err {
Err(err) => stream_sender.send(Err(err)),
Ok(_) => {
packet_router.mark_as_success();
shutdown.mark_as_success();
stream_sender.send(Ok(stream))
}
Expand Down

0 comments on commit e352c25

Please sign in to comment.