From 0675c659d06195c30f8c5bc13e2d88141d57a3ba Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Thu, 12 Nov 2020 13:16:37 +0100 Subject: [PATCH] Try race condition fix --- .../src/protocol/generic_proto/handler/group.rs | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/client/network/src/protocol/generic_proto/handler/group.rs b/client/network/src/protocol/generic_proto/handler/group.rs index c81ae7e21631e..38a2f4f260d01 100644 --- a/client/network/src/protocol/generic_proto/handler/group.rs +++ b/client/network/src/protocol/generic_proto/handler/group.rs @@ -550,25 +550,10 @@ impl ProtocolsHandler for NotifsHandler { }; }, State::OpenDesired { in_substreams, .. } => { - if in_substreams[num].is_some() { - // If a substream already exists, silently drop the new one. - // Note that we drop the substream, which will send an equivalent to a - // TCP "RST" to the remote and force-close the substream. It might - // seem like an unclean way to get rid of a substream. However, keep - // in mind that it is invalid for the remote to open multiple such - // substreams, and therefore sending a "RST" is the most correct thing - // to do. - return; - } in_substreams[num] = Some(proto); }, State::Opening { in_substreams, .. } | State::Open { in_substreams, .. } => { - if in_substreams[num].is_some() { - // Same remark as above. - return; - } - // We create `handshake_message` on a separate line to be sure // that the lock is released as soon as possible. let handshake_message = self.in_protocols[num].1.read().clone();