From 1c90c816b7f01e9a932a52ced5e0bf8d55c15be2 Mon Sep 17 00:00:00 2001 From: Pawan Dhananjay Date: Tue, 21 Jul 2020 06:27:44 +0530 Subject: [PATCH] Close outbound stream after sending (#1369) --- beacon_node/eth2_libp2p/src/rpc/protocol.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/beacon_node/eth2_libp2p/src/rpc/protocol.rs b/beacon_node/eth2_libp2p/src/rpc/protocol.rs index 58ef95460..5fe5afe8e 100644 --- a/beacon_node/eth2_libp2p/src/rpc/protocol.rs +++ b/beacon_node/eth2_libp2p/src/rpc/protocol.rs @@ -395,7 +395,11 @@ where let mut socket = Framed::new(socket, codec); - let future = async { socket.send(self).await.map(|_| socket) }; + let future = async { + socket.send(self).await?; + socket.close().await?; + Ok(socket) + }; Box::pin(future) } }