| 80 | } |
| 81 | |
| 82 | bool 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 | |
| 122 | bool http_servlet::doApp(acl::HttpServletRequest& req, |
| 123 | acl::HttpServletResponse& res) |
nothing calls this directly
no test coverage detected