From ec7cfa85530082127703278cf1ae5167990c0f45 Mon Sep 17 00:00:00 2001 From: Toni Uhlig Date: Mon, 21 Jun 2021 19:55:06 +0200 Subject: Request/Response handling w/ libevent2 Signed-off-by: Toni Uhlig --- src/RequestResponse.hpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/RequestResponse.hpp (limited to 'src/RequestResponse.hpp') diff --git a/src/RequestResponse.hpp b/src/RequestResponse.hpp new file mode 100644 index 0000000..24577aa --- /dev/null +++ b/src/RequestResponse.hpp @@ -0,0 +1,28 @@ +#ifndef REQUEST_RESPONSE_H +#define REQUEST_RESPONSE_H 1 + +#include + +#include + +class RequestResponse { +public: + RequestResponse(struct evhttp_request * const req); + ~RequestResponse(); + + void UseInputHeader(); + void UseOutputHeader(); + + bool AddOutputHeader(std::string & key, std::string & value); + bool AddOutputHeader2(std::string key, std::string value); + + bool GetInputHeader(std::string & key, std::string & value); + bool GetInputHeader2(std::string key, std::string value); + +private: + struct evhttp_request * const m_Request; + struct evkeyvalq * m_InputHeader; + struct evkeyvalq * m_OutputHeader; +}; + +#endif -- cgit v1.2.3