From bb9d5db9694647dd9394cf4885b8e90699632c5a Mon Sep 17 00:00:00 2001 From: arkpar Date: Mon, 8 Feb 2016 15:03:44 +0100 Subject: [PATCH] Check for handshake expiration before attempting replace --- util/src/network/host.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/util/src/network/host.rs b/util/src/network/host.rs index 24c3460db..50cf294bc 100644 --- a/util/src/network/host.rs +++ b/util/src/network/host.rs @@ -599,6 +599,9 @@ impl Host where Message: Send + Sync + Clone { fn start_session(&self, token: StreamToken, io: &IoContext>) { let mut connections = self.connections.write().unwrap(); + if connections.get(token).is_none() { + return; // handshake expired + } connections.replace_with(token, |c| { match Arc::try_unwrap(c).ok().unwrap().into_inner().unwrap() { ConnectionEntry::Handshake(h) => {