Bitcoin ABC 0.26.3
P2P Digital Currency
|
#include <functional>
#include <string>
Go to the source code of this file.
Classes | |
class | HTTPRequest |
In-flight HTTP request. More... | |
class | HTTPClosure |
Event handler closure. More... | |
class | HTTPEvent |
Event class. More... | |
Typedefs | |
typedef std::function< bool(Config &config, HTTPRequest *req, const std::string &)> | HTTPRequestHandler |
Handler for requests to a certain HTTP path. | |
Functions | |
bool | InitHTTPServer (Config &config) |
Initialize HTTP server. | |
void | StartHTTPServer () |
Start HTTP server. | |
void | InterruptHTTPServer () |
Interrupt HTTP server threads. | |
void | StopHTTPServer () |
Stop HTTP server. | |
bool | UpdateHTTPServerLogging (bool enable) |
Change logging level for libevent. | |
void | RegisterHTTPHandler (const std::string &prefix, bool exactMatch, const HTTPRequestHandler &handler) |
Register handler for prefix. | |
void | UnregisterHTTPHandler (const std::string &prefix, bool exactMatch) |
Unregister handler for prefix. | |
struct event_base * | EventBase () |
Return evhttp event base. | |
Variables | |
static const int | DEFAULT_HTTP_THREADS = 4 |
static const int | DEFAULT_HTTP_WORKQUEUE = 16 |
static const int | DEFAULT_HTTP_SERVER_TIMEOUT = 30 |
typedef std::function<bool(Config &config, HTTPRequest *req, const std::string &)> HTTPRequestHandler |
Handler for requests to a certain HTTP path.
Definition at line 51 of file httpserver.h.
struct event_base * EventBase | ( | ) |
Return evhttp event base.
This can be used by submodules to queue timers or custom events.
Definition at line 517 of file httpserver.cpp.
Initialize HTTP server.
Call this before RegisterHTTPHandler or EventBase().
Definition at line 382 of file httpserver.cpp.
void InterruptHTTPServer | ( | ) |
Interrupt HTTP server threads.
Definition at line 472 of file httpserver.cpp.
void RegisterHTTPHandler | ( | const std::string & | prefix, |
bool | exactMatch, | ||
const HTTPRequestHandler & | handler | ||
) |
Register handler for prefix.
If multiple handlers match a prefix, the first-registered one will be invoked.
Definition at line 672 of file httpserver.cpp.
void StartHTTPServer | ( | ) |
Start HTTP server.
This is separate from InitHTTPServer to give users race-condition-free time to register their handlers between InitHTTPServer and StartHTTPServer.
Definition at line 460 of file httpserver.cpp.
void StopHTTPServer | ( | ) |
Stop HTTP server.
Definition at line 483 of file httpserver.cpp.
Unregister handler for prefix.
Definition at line 679 of file httpserver.cpp.
Change logging level for libevent.
Removes BCLog::LIBEVENT from log categories if libevent doesn't support debug logging.
Definition at line 443 of file httpserver.cpp.
|
static |
Definition at line 14 of file httpserver.h.
|
static |
Definition at line 12 of file httpserver.h.
|
static |
Definition at line 13 of file httpserver.h.