mirror of
https://gitee.com/acl-dev/acl.git
synced 2024-12-15 17:30:53 +08:00
9697f95b8f
This reverts commit 15d999759e
.
34 lines
649 B
C++
34 lines
649 B
C++
#include "stdafx.h"
|
|
|
|
class http_servlet : public acl::HttpServlet
|
|
{
|
|
public:
|
|
http_servlet(acl::socket_stream* stream, acl::session* session)
|
|
: HttpServlet(stream, session)
|
|
{
|
|
}
|
|
|
|
~http_servlet(void)
|
|
{
|
|
}
|
|
|
|
// override
|
|
bool doGet(acl::HttpServletRequest& req, acl::HttpServletResponse& res)
|
|
{
|
|
return doPost(req, res);
|
|
}
|
|
|
|
// override
|
|
bool doPost(acl::HttpServletRequest&, acl::HttpServletResponse& res)
|
|
{
|
|
const char* buf = "hello world!";
|
|
size_t len = strlen(buf);
|
|
|
|
res.setContentLength(len);
|
|
res.setKeepAlive(true);
|
|
|
|
// ·¢ËÍ http ÏìÓ¦Ìå
|
|
return res.write(buf, len) && res.write(NULL, 0);
|
|
}
|
|
};
|