refactor: Coroutine based webserver (#1699)

Code of new coroutine-based web server. The new server is not connected
to Clio and not ready to use yet.
For #919.
This commit is contained in:
Sergey Kuznetsov
2024-10-24 16:50:26 +01:00
committed by GitHub
parent cf081e7e25
commit cffda52ba6
58 changed files with 5581 additions and 488 deletions

View File

@@ -21,9 +21,11 @@
#include <boost/asio/io_context.hpp>
#include <boost/asio/ip/tcp.hpp>
#include <boost/asio/spawn.hpp>
#include <boost/beast/http/message.hpp>
#include <boost/beast/http/string_body.hpp>
#include <expected>
#include <functional>
#include <optional>
#include <string>
@@ -44,6 +46,15 @@ public:
*/
TestHttpServer(boost::asio::io_context& context, std::string host);
/**
* @brief Accept a new connection
*
* @param yield boost::asio::yield_context to use for networking
* @return Either a socket with the new connection or an error code
*/
std::expected<boost::asio::ip::tcp::socket, boost::system::error_code>
accept(boost::asio::yield_context yield);
/**
* @brief Start the server
*