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

Method doPost

app/http_logger/logger_servlet.cpp:26–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24}
25
26bool 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}

Callers

nothing calls this directly

Calls 6

getRequestUriMethod · 0.80
getRemoteHostMethod · 0.80
getClientMethod · 0.80
formatMethod · 0.45
c_strMethod · 0.45
read_bodyMethod · 0.45

Tested by

no test coverage detected