MCPcopy Create free account
hub / github.com/cinemast/libjson-rpc-cpp / SendResponse

Method SendResponse

src/jsonrpccpp/server/connectors/httpserver.cpp:105–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105bool HttpServer::SendResponse(const string &response, void *addInfo) {
106 struct mhd_coninfo *client_connection = static_cast<struct mhd_coninfo *>(addInfo);
107 struct MHD_Response *result = MHD_create_response_from_buffer(response.size(), (void *)response.c_str(), MHD_RESPMEM_MUST_COPY);
108
109 MHD_add_response_header(result, "Content-Type", "application/json");
110 MHD_add_response_header(result, "Access-Control-Allow-Origin", "*");
111
112 int ret = MHD_queue_response(client_connection->connection, client_connection->code, result);
113 MHD_destroy_response(result);
114 return ret == MHD_YES;
115}
116
117bool HttpServer::SendOptionsResponse(void *addInfo) {
118 struct mhd_coninfo *client_connection = static_cast<struct mhd_coninfo *>(addInfo);

Callers 1

callbackMethod · 0.45

Calls 2

sizeMethod · 0.80
c_strMethod · 0.80

Tested by

no test coverage detected