summaryrefslogtreecommitdiff
path: root/src/network/protocol.h
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2023-09-17 19:27:34 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2023-09-18 21:48:17 +0200
commit1e374ab639af7afbdffd3be3be22be4ba21858e6 (patch)
treeb691db1b347087e769ed487f371f17bf91a609a4 /src/network/protocol.h
parent512e20fa063e4a4525e47e048f26cc68668e7fac (diff)
Network: acknowledgment using packet counter
Diffstat (limited to 'src/network/protocol.h')
-rw-r--r--src/network/protocol.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/network/protocol.h b/src/network/protocol.h
index 3d7c073..ba40744 100644
--- a/src/network/protocol.h
+++ b/src/network/protocol.h
@@ -116,7 +116,7 @@ public:
private:
static optional<Header> parsePacket(vector<uint8_t> & buf,
Channel * channel, const PartialStorage & st,
- bool & secure);
+ optional<uint64_t> & secure);
unique_ptr<ConnectionPriv> p;
};
@@ -128,6 +128,7 @@ struct NetworkProtocol::ConnectionReadReady { Connection::Id id; };
struct NetworkProtocol::Header
{
struct Acknowledged { Digest value; };
+ struct AcknowledgedSingle { uint64_t value; };
struct Version { string value; };
struct Initiation { Digest value; };
struct CookieSet { Cookie value; };
@@ -143,6 +144,7 @@ struct NetworkProtocol::Header
using Item = variant<
Acknowledged,
+ AcknowledgedSingle,
Version,
Initiation,
CookieSet,
@@ -162,6 +164,7 @@ struct NetworkProtocol::Header
PartialObject toObject(const PartialStorage &) const;
template<class T> const T * lookupFirst() const;
+ bool isAcknowledged() const;
vector<Item> items;
};