5 #ifndef BITCOIN_HTTPSERVER_H 6 #define BITCOIN_HTTPSERVER_H 10 #include <boost/thread.hpp> 11 #include <boost/scoped_ptr.hpp> 12 #include <boost/function.hpp> 18 struct evhttp_request;
58 struct evhttp_request*
req;
89 std::pair<bool, std::string>
GetHeader(
const std::string& hdr);
104 void WriteHeader(
const std::string& hdr,
const std::string& value);
114 void WriteReply(
int nStatus,
const std::string& strReply =
"");
141 void trigger(
struct timeval* tv);
149 #endif // BITCOIN_HTTPSERVER_H bool(* handler)(HTTPRequest *req, const std::string &strReq)
static const int DEFAULT_HTTP_SERVER_TIMEOUT
static const int DEFAULT_HTTP_WORKQUEUE
HTTPEvent(struct event_base *base, bool deleteWhenTriggered, const boost::function< void(void)> &handler)
void UnregisterHTTPHandler(const std::string &prefix, bool exactMatch)
void trigger(struct timeval *tv)
void InterruptHTTPServer()
struct event_base * EventBase()
void WriteReply(int nStatus, const std::string &strReply="")
boost::function< void(void)> handler
virtual void operator()()=0
std::pair< bool, std::string > GetHeader(const std::string &hdr)
HTTPRequest(struct evhttp_request *req)
void RegisterHTTPHandler(const std::string &prefix, bool exactMatch, const HTTPRequestHandler &handler)
RequestMethod GetRequestMethod()
struct evhttp_request * req
void WriteHeader(const std::string &hdr, const std::string &value)
boost::function< void(HTTPRequest *req, const std::string &)> HTTPRequestHandler
static const int DEFAULT_HTTP_THREADS