From e8ec54fc3797e4cd23aa2e9be7df8ae4b3f00201 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com>
Date: Wed, 30 Jun 2021 01:28:37 -0400
Subject: [PATCH] MultiplexedSocket: don't send EOF when receiving EOF

If we receive EOF, didn't the peer already closed the socket ?

Change-Id: I06ae908b49ddd4ba0a5eb43ff25f51da1f15cc21
---
 src/jamidht/multiplexed_socket.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/jamidht/multiplexed_socket.cpp b/src/jamidht/multiplexed_socket.cpp
index b72adee324..5b4a9c16dc 100644
--- a/src/jamidht/multiplexed_socket.cpp
+++ b/src/jamidht/multiplexed_socket.cpp
@@ -421,7 +421,7 @@ MultiplexedSocket::Impl::handleChannelPacket(uint16_t channel, std::vector<uint8
     auto sockIt = sockets.find(channel);
     if (channel > 0 && sockIt->second) {
         if (pkt.size() == 0) {
-            sockIt->second->shutdown();
+            sockIt->second->stop();
             sockets.erase(sockIt);
         } else {
             sockIt->second->onRecv(std::move(pkt));
@@ -789,7 +789,6 @@ ChannelSocket::onRecv(std::vector<uint8_t>&& pkt) {
     pimpl_->cv.notify_all();
 }
 
-
 std::shared_ptr<IceTransport>
 ChannelSocket::underlyingICE() const
 {
-- 
GitLab