http: switch servers from libevent to bitcoin

This commit is contained in:
Matthew Zipkin
2025-01-15 15:44:16 -05:00
parent cbb8d1fb33
commit 21c7542cf8
8 changed files with 44 additions and 58 deletions

View File

@@ -75,8 +75,12 @@ void StopHTTPServer();
void UpdateHTTPServerLogging(bool enable);
} // namespace http_libevent
namespace http_bitcoin {
class HTTPRequest;
}
/** Handler for requests to a certain HTTP path */
typedef std::function<void(http_libevent::HTTPRequest* req, const std::string &)> HTTPRequestHandler;
using HTTPRequestHandler = std::function<void(http_bitcoin::HTTPRequest* req, const std::string&)>;
/** Register handler for prefix.
* If multiple handlers match a prefix, the first-registered one will
* be invoked.
@@ -86,11 +90,6 @@ void RegisterHTTPHandler(const std::string &prefix, bool exactMatch, const HTTPR
void UnregisterHTTPHandler(const std::string &prefix, bool exactMatch);
namespace http_libevent {
/** Return evhttp event base. This can be used by submodules to
* queue timers or custom events.
*/
struct event_base* EventBase();
/** In-flight HTTP request.
* Thin C++ wrapper around evhttp_request.
*/