This commit is contained in:
Jon Häggblad
2023-01-13 15:26:26 +01:00
parent 6b52132501
commit dae7568b6f
2 changed files with 4 additions and 0 deletions
@@ -43,6 +43,7 @@ impl ActiveClientsStore {
///
/// * `client`: address of the client for which to remove the handle.
pub(crate) fn disconnect(&self, client: DestinationAddressBytes) {
log::debug!("ActiveClientsStore:: explicit disconnect: {}", client);
self.0.remove(&client);
}
@@ -53,6 +54,7 @@ impl ActiveClientsStore {
/// * `client`: address of the client for which to insert the handle.
/// * `handle`: the sender channel for all mix packets to be pushed back onto the websocket
pub(crate) fn insert(&self, client: DestinationAddressBytes, handle: MixMessageSender) {
log::debug!("ActiveClientsStore::insert: {}", client);
self.0.insert(client, handle);
}
@@ -99,6 +99,7 @@ pub(crate) struct AuthenticatedHandler<R, S, St> {
// explicitly remove handle from the global store upon being dropped
impl<R, S, St> Drop for AuthenticatedHandler<R, S, St> {
fn drop(&mut self) {
log::debug!("AuthenticatedHandler::drop");
self.inner
.active_clients_store
.disconnect(self.client.address)
@@ -134,6 +135,7 @@ where
/// Explicitly removes handle from the global store.
fn disconnect(self) {
log::debug!("AuthenticatedHandler::disconnect");
self.inner
.active_clients_store
.disconnect(self.client.address)