diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2023-09-17 19:27:34 +0200 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2023-09-18 21:48:17 +0200 |
commit | 1e374ab639af7afbdffd3be3be22be4ba21858e6 (patch) | |
tree | b691db1b347087e769ed487f371f17bf91a609a4 /src/network.cpp | |
parent | 512e20fa063e4a4525e47e048f26cc68668e7fac (diff) |
Network: acknowledgment using packet counter
Diffstat (limited to 'src/network.cpp')
-rw-r--r-- | src/network.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/network.cpp b/src/network.cpp index 6840f43..2b8c46b 100644 --- a/src/network.cpp +++ b/src/network.cpp @@ -520,7 +520,8 @@ void Server::Priv::handlePacket(Server::Peer & peer, const NetworkProtocol::Head else if (const auto * rsp = get_if<NetworkProtocol::Header::DataResponse>(&item)) { const auto & dgst = rsp->value; - reply.header({ NetworkProtocol::Header::Acknowledged { dgst } }); + if (not holds_alternative<unique_ptr<Channel>>(peer.connection.channel())) + reply.header({ NetworkProtocol::Header::Acknowledged { dgst } }); for (auto & pwref : waiting) { if (auto wref = pwref.lock()) { if (std::find(wref->missing.begin(), wref->missing.end(), dgst) != @@ -554,7 +555,6 @@ void Server::Priv::handlePacket(Server::Peer & peer, const NetworkProtocol::Head else if (const auto * anu = get_if<NetworkProtocol::Header::AnnounceUpdate>(&item)) { if (holds_alternative<Identity>(peer.identity)) { const auto & dgst = anu->value; - reply.header({ NetworkProtocol::Header::Acknowledged { dgst } }); shared_ptr<WaitingRef> wref(new WaitingRef { .storage = peer.tempStorage, @@ -628,8 +628,6 @@ void Server::Priv::handlePacket(Server::Peer & peer, const NetworkProtocol::Head if (serviceType) { const auto & dgst = sref->value; auto pref = peer.partStorage.ref(dgst); - if (pref) - reply.header({ NetworkProtocol::Header::Acknowledged { dgst } }); shared_ptr<WaitingRef> wref(new WaitingRef { .storage = peer.tempStorage, |