Fixes issue mentioned in #164: remote endpoint address and port was not correctly set. Request::remote_endpoint_address and Request::remote_endpoint_port are now functions instead of variables in order to reduce unnecessary instructions.

This commit is contained in:
eidheim 2017-11-05 18:48:21 +01:00
commit 6e0a1ec9e8
5 changed files with 35 additions and 19 deletions

View file

@ -89,7 +89,7 @@ int main() {
// Responds with request-information
server.resource["^/info$"]["GET"] = [](shared_ptr<HttpServer::Response> response, shared_ptr<HttpServer::Request> request) {
stringstream stream;
stream << "<h1>Request from " << request->remote_endpoint_address << ":" << request->remote_endpoint_port << "</h1>";
stream << "<h1>Request from " << request->remote_endpoint_address() << ":" << request->remote_endpoint_port() << "</h1>";
stream << request->method << " " << request->path << " HTTP/" << request->http_version;