From ebb92947a326694c14c3307e15697611721664fe Mon Sep 17 00:00:00 2001 From: Svyatoslav Nikolsky Date: Wed, 14 Feb 2018 12:49:56 +0300 Subject: [PATCH] SecretStore: fixed test (#7878) --- .../admin_sessions/key_version_negotiation_session.rs | 6 +++--- secret_store/src/key_server_cluster/cluster.rs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/secret_store/src/key_server_cluster/admin_sessions/key_version_negotiation_session.rs b/secret_store/src/key_server_cluster/admin_sessions/key_version_negotiation_session.rs index 19fef08bc..1fb3a3fe6 100644 --- a/secret_store/src/key_server_cluster/admin_sessions/key_version_negotiation_session.rs +++ b/secret_store/src/key_server_cluster/admin_sessions/key_version_negotiation_session.rs @@ -191,9 +191,9 @@ impl SessionImpl where T: SessionTransport { self.data.lock().continue_with = Some(action); } - /// Get continue action. - pub fn continue_action(&self) -> Option { - self.data.lock().continue_with.clone() + /// Take continue action. + pub fn take_continue_action(&self) -> Option { + self.data.lock().continue_with.take() } /// Wait for session completion. diff --git a/secret_store/src/key_server_cluster/cluster.rs b/secret_store/src/key_server_cluster/cluster.rs index d5f4b776b..0f8ebdd60 100644 --- a/secret_store/src/key_server_cluster/cluster.rs +++ b/secret_store/src/key_server_cluster/cluster.rs @@ -471,7 +471,7 @@ impl ClusterCore { if is_master_node && session.is_finished() { data.sessions.negotiation_sessions.remove(&session.id()); match session.wait() { - Ok((version, master)) => match session.continue_action() { + Ok((version, master)) => match session.take_continue_action() { Some(ContinueAction::Decrypt(session, is_shadow_decryption)) => { let initialization_error = if data.self_key_pair.public() == &master { session.initialize(version, is_shadow_decryption, false) @@ -498,7 +498,7 @@ impl ClusterCore { }, None => (), }, - Err(error) => match session.continue_action() { + Err(error) => match session.take_continue_action() { Some(ContinueAction::Decrypt(session, _)) => { data.sessions.decryption_sessions.remove(&session.id()); session.on_session_error(&meta.self_node_id, error);