2019-07-28 10:31:56 +08:00
|
|
|
#pragma once
|
2014-11-19 00:25:21 +08:00
|
|
|
|
2020-08-21 14:51:09 +08:00
|
|
|
class http_service;
|
|
|
|
|
2014-11-19 00:25:21 +08:00
|
|
|
class http_servlet : public acl::HttpServlet
|
|
|
|
{
|
|
|
|
public:
|
2020-08-21 14:51:09 +08:00
|
|
|
http_servlet(http_service& service, acl::socket_stream* conn,
|
|
|
|
acl::session* session);
|
|
|
|
~http_servlet(void);
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
|
|
protected:
|
2017-09-01 17:43:12 +08:00
|
|
|
// @override
|
2020-08-21 14:51:09 +08:00
|
|
|
bool doGet(HttpRequest& req, HttpResponse& res);
|
|
|
|
|
|
|
|
// @override
|
|
|
|
bool doPost(HttpRequest& req, HttpResponse& res);
|
|
|
|
|
|
|
|
// @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);
|
2017-09-01 17:43:12 +08:00
|
|
|
|
|
|
|
// @override
|
2020-08-21 14:51:09 +08:00
|
|
|
bool doPurge(HttpRequest& req, HttpResponse& res);
|
2017-09-01 17:43:12 +08:00
|
|
|
|
|
|
|
// @override
|
2020-08-21 14:51:09 +08:00
|
|
|
bool doDelete(HttpRequest& req, HttpResponse& res);
|
2017-09-01 17:43:12 +08:00
|
|
|
|
|
|
|
// @override
|
2020-08-21 14:51:09 +08:00
|
|
|
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);
|
|
|
|
|
|
|
|
// @override
|
|
|
|
bool doError(HttpRequest& req, HttpResponse& res);
|
|
|
|
|
|
|
|
// @override
|
|
|
|
bool doOther(HttpRequest&, HttpResponse& res, const char* method);
|
2017-09-01 17:43:12 +08:00
|
|
|
|
|
|
|
private:
|
2020-08-21 14:51:09 +08:00
|
|
|
http_service& service_;
|
|
|
|
|
|
|
|
bool doService(int type, HttpRequest& req, HttpResponse& res);
|
2014-11-19 00:25:21 +08:00
|
|
|
};
|