From 47bd6afb103c5ddfb4a878e95416793610ed1be3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Thu, 14 Nov 2024 19:56:50 +0100 Subject: Move ReplyBuilder and WaitingRef definitions to network.h --- src/network.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/network.h') diff --git a/src/network.h b/src/network.h index 1fc2c87..8ea8b6c 100644 --- a/src/network.h +++ b/src/network.h @@ -136,4 +136,30 @@ struct Server::Priv vector> services; }; +class ReplyBuilder +{ +public: + using Header = NetworkProtocol::Header; + + void header( Header::Item && ); + void body( const Ref & ); + + const vector< Header::Item > & header() const { return mheader; } + vector< Object > body() const; + +private: + vector< Header::Item > mheader; + vector< Ref > mbody; +}; + +struct WaitingRef +{ + const Storage storage; + const PartialRef ref; + vector< Digest > missing; + + optional< Ref > check(); + optional< Ref > check( ReplyBuilder &, const vector< Digest > &); +}; + } -- cgit v1.2.3