From cd00813c0740930d389f935f0c2d7d8a11eef02d Mon Sep 17 00:00:00 2001 From: HampusM Date: Fri, 13 May 2022 22:33:12 +0200 Subject: refactor(minion): wifi module create http request object in stack --- minion/src/http/request.hpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'minion/src/http/request.hpp') diff --git a/minion/src/http/request.hpp b/minion/src/http/request.hpp index 85af722..8524dc6 100644 --- a/minion/src/http/request.hpp +++ b/minion/src/http/request.hpp @@ -25,7 +25,7 @@ class HTTPRequest { public: explicit HTTPRequest( - size_t connection_id, + int connection_id, HTTPRequestMethod method, char *http_version, char *path, @@ -35,11 +35,11 @@ public: HTTPRequest(const HTTPRequest &other) noexcept = delete; - HTTPRequest(HTTPRequest &&other) noexcept = delete; + HTTPRequest(HTTPRequest &&other) noexcept; ~HTTPRequest() noexcept; - auto connection_id() const noexcept -> size_t; + auto connection_id() const noexcept -> int; auto method() const noexcept -> HTTPRequestMethod; @@ -53,13 +53,17 @@ public: auto operator=(const HTTPRequest &other) noexcept -> HTTPRequest & = delete; - auto operator=(HTTPRequest &&other) noexcept -> HTTPRequest & = delete; + auto operator=(HTTPRequest &&other) noexcept -> HTTPRequest &; + + static HTTPRequest create_invalid() noexcept; private: - const size_t _connection_id; + const int _connection_id; const HTTPRequestMethod _method; char *_http_version; char *_path; const int _data_length; char *_data; + + HTTPRequest() noexcept; }; -- cgit v1.2.3-18-g5258