2019-07-28 10:31:56 +08:00
|
|
|
#pragma once
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
|
|
class http_servlet : public acl::HttpServlet
|
|
|
|
{
|
|
|
|
public:
|
2020-06-29 14:34:16 +08:00
|
|
|
http_servlet(http_handlers_t*, acl::socket_stream*, acl::session*);
|
2019-07-20 16:41:23 +08:00
|
|
|
~http_servlet(void);
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
|
|
protected:
|
2017-09-01 17:43:12 +08:00
|
|
|
// @override
|
2020-06-29 14:34:16 +08:00
|
|
|
bool doGet(HttpRequest&, HttpResponse&);
|
2017-09-01 17:43:12 +08:00
|
|
|
|
|
|
|
// @override
|
2020-06-29 14:34:16 +08:00
|
|
|
bool doPost(HttpRequest&, HttpResponse&);
|
|
|
|
|
|
|
|
// override
|
|
|
|
bool doHead(HttpRequest& req, HttpResponse& res);
|
|
|
|
|
|
|
|
// override
|
|
|
|
bool doPut(HttpRequest& req, HttpResponse& res);
|
|
|
|
|
|
|
|
// override
|
|
|
|
bool doPatch(HttpRequest& req, HttpResponse& res);
|
|
|
|
|
|
|
|
// override
|
|
|
|
bool doConnect(HttpRequest& req, HttpResponse& res);
|
|
|
|
|
|
|
|
// override
|
|
|
|
bool doPurge(HttpRequest& req, HttpResponse& res);
|
|
|
|
|
|
|
|
// override
|
|
|
|
bool doDelete(HttpRequest& req, HttpResponse& res);
|
|
|
|
|
|
|
|
// override
|
|
|
|
bool doOptions(HttpRequest& req, HttpResponse& res);
|
|
|
|
|
|
|
|
// override
|
|
|
|
bool doProfind(HttpRequest& req, HttpResponse& res);
|
|
|
|
|
|
|
|
// override
|
|
|
|
bool doWebsocket(HttpRequest& req, HttpResponse& res);
|
|
|
|
|
|
|
|
// override
|
|
|
|
bool doUnknown(HttpRequest& req, HttpResponse& res);
|
2017-09-01 17:43:12 +08:00
|
|
|
|
|
|
|
// @override
|
2020-06-29 14:34:16 +08:00
|
|
|
bool doError(HttpRequest&, HttpResponse&);
|
2017-09-01 17:43:12 +08:00
|
|
|
|
|
|
|
// @override
|
2020-06-29 14:34:16 +08:00
|
|
|
bool doOther(HttpRequest&, HttpResponse&, const char* method);
|
2017-09-01 17:43:12 +08:00
|
|
|
|
|
|
|
private:
|
2020-06-29 14:34:16 +08:00
|
|
|
http_handlers_t* handlers_;
|
2017-09-01 17:43:12 +08:00
|
|
|
|
2020-06-29 14:34:16 +08:00
|
|
|
bool doService(int type, HttpRequest& req, HttpResponse& res);
|
2014-11-19 00:25:21 +08:00
|
|
|
};
|