MCPcopy Create free account
hub / github.com/acl-dev/acl / doPost

Method doPost

app/master/tools/master_dispatch/www/http_servlet.cpp:82–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80}
81
82bool http_servlet::doPost(acl::HttpServletRequest& req,
83 acl::HttpServletResponse& res)
84{
85 // �����Ҫ http session ���ƣ��������ע�ͣ�����Ҫ��֤
86 // �� master_service.cpp �ĺ��� thread_on_read �����õ�
87 // memcached ������������
88 /*
89 const char* sid = req.getSession().getAttribute("sid");
90 if (*sid == 0)
91 req.getSession().setAttribute("sid", "xxxxxx");
92 sid = req.getSession().getAttribute("sid");
93 */
94
95 res.setCharacterEncoding("utf-8") // ������Ӧ�ַ���
96 .setKeepAlive(req.isKeepAlive()) // �����Ƿ񱣳ֳ�����
97 .setContentEncoding(false) // �Զ�֧��ѹ������
98 .setChunkedTransferEncoding(false); // ���� chunk ���䷽ʽ
99
100 acl::string path;
101 path = req.getPathInfo();
102 if (path.empty())
103 {
104 logger_error("getPathInfo NULL");
105 return doReply(req, res, 400, "%s", "no PathInfo");
106 }
107 path.strip("..");
108 if (path.empty())
109 {
110 logger_error("path empty");
111 return doReply(req, res, 400, "%s", "path empty");
112 }
113
114 const std::vector<acl::string>& tokens = path.split2("/");
115 // printf(">>>path: %s, size: %ld\r\n", path.c_str(), tokens.size());
116 if (tokens.size() < 2 || !tokens[1].equal("website", false))
117 return doApp(req, res);
118 else
119 return doDoc(req, res, path);
120}
121
122bool http_servlet::doApp(acl::HttpServletRequest& req,
123 acl::HttpServletResponse& res)

Callers

nothing calls this directly

Calls 6

setContentEncodingMethod · 0.80
isKeepAliveMethod · 0.80
getPathInfoMethod · 0.80
equalMethod · 0.80
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected