![]() |
Fabcoin Core
0.16.2
P2P Digital Currency
|
#include <string>#include <stdint.h>#include <functional>#include <mutex>#include <condition_variable>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(HTTPRequest *req, const std::string &)> | HTTPRequestHandler |
| Handler for requests to a certain HTTP path. More... | |
Functions | |
| bool | InitHTTPServer () |
| Initialize HTTP server. More... | |
| bool | StartHTTPServer () |
| Start HTTP server. More... | |
| void | InterruptHTTPServer () |
| Interrupt HTTP server threads. More... | |
| void | StopHTTPServer () |
| Stop HTTP server. More... | |
| bool | UpdateHTTPServerLogging (bool enable) |
| Change logging level for libevent. More... | |
| void | RegisterHTTPHandler (const std::string &prefix, bool exactMatch, const HTTPRequestHandler &handler) |
| Register handler for prefix. More... | |
| void | UnregisterHTTPHandler (const std::string &prefix, bool exactMatch) |
| Unregister handler for prefix. More... | |
| struct event_base * | EventBase () |
| Return evhttp event base. More... | |
| std::string | urlDecode (const std::string &urlEncoded) |
| typedef std::function<bool(HTTPRequest* req, const std::string &)> HTTPRequestHandler |
Handler for requests to a certain HTTP path.
Definition at line 42 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 519 of file httpserver.cpp.
| bool InitHTTPServer | ( | ) |
Initialize HTTP server.
Call this before RegisterHTTPHandler or EventBase().
Definition at line 379 of file httpserver.cpp.
| void InterruptHTTPServer | ( | ) |
Interrupt HTTP server threads.
Definition at line 470 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 786 of file httpserver.cpp.
| bool 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 454 of file httpserver.cpp.
| void StopHTTPServer | ( | ) |
Stop HTTP server.
Definition at line 485 of file httpserver.cpp.
| void UnregisterHTTPHandler | ( | const std::string & | prefix, |
| bool | exactMatch | ||
| ) |
Unregister handler for prefix.
Definition at line 792 of file httpserver.cpp.
| bool UpdateHTTPServerLogging | ( | bool | enable | ) |
Change logging level for libevent.
Removes BCLog::LIBEVENT from logCategories if libevent doesn't support debug logging.
Definition at line 437 of file httpserver.cpp.
| std::string urlDecode | ( | const std::string & | urlEncoded | ) |
1.8.11