refactor: Add ExecuteHTTPRPC function

Add ExecuteHTTPRPC to provide a way to execute an HTTP request without relying
on HTTPRequest and libevent types.

Behavior is not changing in any way, this is just moving code. This commit may
be easiest to review using git's --color-moved option.
This commit is contained in:
Ryan Ofsky
2025-04-17 09:34:36 -04:00
parent 3cd1cd3ad3
commit df76891a3b
4 changed files with 87 additions and 70 deletions

View File

@@ -50,7 +50,7 @@ void StopHTTPServer();
void UpdateHTTPServerLogging(bool enable);
/** Handler for requests to a certain HTTP path */
typedef std::function<bool(HTTPRequest* req, const std::string &)> HTTPRequestHandler;
typedef std::function<void(HTTPRequest* req, const std::string &)> HTTPRequestHandler;
/** Register handler for prefix.
* If multiple handlers match a prefix, the first-registered one will
* be invoked.