summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/network.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/network.cpp b/src/network.cpp
index 305f073..cd13bc4 100644
--- a/src/network.cpp
+++ b/src/network.cpp
@@ -642,18 +642,19 @@ void Server::Priv::handlePacket(Server::Peer & peer, const TransportHeader & hea
if (!serviceType)
break;
- if (auto pref = std::get<PartialRef>(item.value)) {
- shared_ptr<WaitingRef> wref(new WaitingRef {
- .storage = peer.tempStorage,
+ auto pref = std::get<PartialRef>(item.value);
+ if (pref)
+ reply.header({ TransportHeader::Type::Acknowledged, pref });
+
+ shared_ptr<WaitingRef> wref(new WaitingRef {
+ .storage = peer.tempStorage,
.ref = pref,
.peer = peer,
.missing = {},
- });
- waiting.push_back(wref);
- peer.serviceQueue.emplace_back(*serviceType, wref);
- reply.header({ TransportHeader::Type::Acknowledged, pref });
- wref->check(reply);
- }
+ });
+ waiting.push_back(wref);
+ peer.serviceQueue.emplace_back(*serviceType, wref);
+ wref->check(reply);
}
}
}