| 62 | } |
| 63 | |
| 64 | bool RelayHttpMetaDiscovery::processRequest(ACE_SOCK_Stream& peer, |
| 65 | const std::string& request) const |
| 66 | { |
| 67 | std::string target; |
| 68 | if (requestIsComplete(request, target)) { |
| 69 | std::stringstream response; |
| 70 | if (target == "/config") { |
| 71 | respond(response); |
| 72 | } else if (target == "/healthcheck") { |
| 73 | respondHealthcheck(response); |
| 74 | } else { |
| 75 | respondStatus(response, HTTP_NOT_FOUND); |
| 76 | } |
| 77 | const std::string& r = response.str(); |
| 78 | peer.send(r.data(), r.size()); |
| 79 | if (config_.log_http()) { |
| 80 | ACE_INET_Addr remote; |
| 81 | if (peer.get_remote_addr(remote) == 0) { |
| 82 | ACE_DEBUG((LM_INFO, "(%P|%t) INFO: Request from %C\n%C\n%C\n", OpenDDS::DCPS::LogAddr(remote).c_str(), request.c_str(), r.c_str())); |
| 83 | } |
| 84 | } |
| 85 | return true; |
| 86 | } |
| 87 | return false; |
| 88 | } |
| 89 | |
| 90 | bool RelayHttpMetaDiscovery::parseRequestLine(const std::string& requestLine, |
| 91 | std::string& target) const |