HTTP server functionality is in there.

This commit is contained in:
2022-05-20 17:12:58 -04:00
parent cd3064eb05
commit ca271b8db1
9 changed files with 932 additions and 208 deletions

View File

@@ -206,14 +206,23 @@ public:
void update_source(const util::LuaSourceVec &source);
// Supply an HTTP response to an outstanding HTTP request.
//
void http_response(const HttpParser &response);
void http_responses(const HttpParserVec &responses);
// Abort all HTTP requests. This is typically used after
// reloading a world from a save-game. The http requests that
// were in progress are long-since dead.
//
void abort_all_http_requests(int status_code, std::string_view error);
// Serve an HTTP query coming in from outside.
//
// Note: the lua code for the http_serve runs in a nonblocking
// context. It must produce a result instantly.
//
HttpServerResponse http_serve(const HttpParser &request);
// Run all unit tests.
//
void run_unittests();