summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2021-01-29 22:33:07 +0100
committerRoman Smrž <roman.smrz@seznam.cz>2021-01-29 22:33:07 +0100
commitfc368248316aebeb756bdd8b85d3f819eddc49d1 (patch)
tree25a3ff34cbdcf9d28c0673526f6452ca828b1a71
parenta16b33031c7bcf2eabf1e0c3571000234b7740df (diff)
Network: reply to any data request with secure channel
-rw-r--r--src/network.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/network.cpp b/src/network.cpp
index 48ba4b9..9081b18 100644
--- a/src/network.cpp
+++ b/src/network.cpp
@@ -398,7 +398,8 @@ void Server::Priv::handlePacket(Server::Peer & peer, const TransportHeader & hea
case TransportHeader::Type::DataRequest: {
auto pref = std::get<PartialRef>(item.value);
- if (plaintextRefs.find(pref.digest()) != plaintextRefs.end()) {
+ if (holds_alternative<Stored<Channel>>(peer.channel) ||
+ plaintextRefs.find(pref.digest()) != plaintextRefs.end()) {
if (auto ref = peer.tempStorage.ref(pref.digest())) {
TransportHeader::Item hitem { TransportHeader::Type::DataResponse, *ref };
reply.header({ TransportHeader::Type::DataResponse, *ref });