| 24 | } |
| 25 | |
| 26 | bool logger_servlet::doPost(acl::HttpServletRequest& req, |
| 27 | acl::HttpServletResponse&) |
| 28 | { |
| 29 | const char* uri = req.getRequestUri(); |
| 30 | if (uri == NULL || *uri == 0) |
| 31 | { |
| 32 | logger_debug(DEBUG_HTTP, 1, "getRequestUri null"); |
| 33 | return false; |
| 34 | } |
| 35 | |
| 36 | const char* host = req.getRemoteHost(); |
| 37 | if (host == NULL || *host == 0) |
| 38 | { |
| 39 | logger_debug(DEBUG_HTTP, 1, "no Host"); |
| 40 | return false; |
| 41 | } |
| 42 | |
| 43 | acl::string url; |
| 44 | url.format("http://%s/%s", host, uri); |
| 45 | logger("%s", url.c_str()); |
| 46 | |
| 47 | int n; |
| 48 | char buf[8192]; |
| 49 | acl::http_client* conn = req.getClient(); |
| 50 | while (true) |
| 51 | { |
| 52 | n = conn->read_body(buf, sizeof(buf)); |
| 53 | if (n < 0) |
| 54 | return false; |
| 55 | else if (n == 0) |
| 56 | break; |
| 57 | } |
| 58 | |
| 59 | return true; |
| 60 | } |
nothing calls this directly
no test coverage detected