equal
deleted
inserted
replaced
54 // TODO: return also HTTP headers |
54 // TODO: return also HTTP headers |
55 if (impl->requestHandler) { |
55 if (impl->requestHandler) { |
56 HTTPServer::Request request; |
56 HTTPServer::Request request; |
57 request.method = method; |
57 request.method = method; |
58 request.url = url; |
58 request.url = url; |
|
59 |
|
60 // TODO: return also client IP address etc. |
|
61 // const MHD_ConnectionInfo* connetionInfo = MHD_get_connection_info(connection, MHD_ConnectionInfoType::MHD_CONNECTION_INFO_CLIENT_ADDRESS); |
|
62 |
59 // FIXME: request.body = ... |
63 // FIXME: request.body = ... |
60 // FIXME: multiple calls for one request |
64 // FIXME: multiple calls for one request |
61 const HTTPServer::Response response = impl->requestHandler->handle(request); |
65 const HTTPServer::Response response = impl->requestHandler->handle(request); |
62 struct MHD_Response* mhdResponse = MHD_create_response_from_buffer(response.body.size(), (void*) response.body.c_str(), MHD_RESPMEM_MUST_COPY); |
66 struct MHD_Response* mhdResponse = MHD_create_response_from_buffer(response.body.size(), (void*) response.body.c_str(), MHD_RESPMEM_MUST_COPY); |
63 for (Header h : response.header) MHD_add_response_header(mhdResponse, h.name.c_str(), h.value.c_str()); |
67 for (Header h : response.header) MHD_add_response_header(mhdResponse, h.name.c_str(), h.value.c_str()); |