}
}
-int HTTPD::answer_to_connection_thunk(void *cls, MHD_Connection *connection,
- const char *url, const char *method,
- const char *version, const char *upload_data,
- size_t *upload_data_size, void **con_cls)
+HTTPD::MHD_Result HTTPD::answer_to_connection_thunk(void *cls, MHD_Connection *connection,
+ const char *url, const char *method,
+ const char *version, const char *upload_data,
+ size_t *upload_data_size, void **con_cls)
{
HTTPD *httpd = (HTTPD *)cls;
return httpd->answer_to_connection(connection, url, method, version, upload_data, upload_data_size, con_cls);
}
-int HTTPD::answer_to_connection(MHD_Connection *connection,
- const char *url, const char *method,
- const char *version, const char *upload_data,
- size_t *upload_data_size, void **con_cls)
+HTTPD::MHD_Result HTTPD::answer_to_connection(MHD_Connection *connection,
+ const char *url, const char *method,
+ const char *version, const char *upload_data,
+ size_t *upload_data_size, void **con_cls)
{
// See if the URL ends in “.metacube”.
HTTPD::Stream::Framing framing;
MHD_Response *response = MHD_create_response_from_buffer(
contents.size(), &contents[0], MHD_RESPMEM_MUST_COPY);
MHD_add_response_header(response, "Content-type", "text/plain");
- int ret = MHD_queue_response(connection, MHD_HTTP_OK, response);
+ MHD_Result ret = MHD_queue_response(connection, MHD_HTTP_OK, response);
MHD_destroy_response(response); // Only decreases the refcount; actual free is after the request is done.
return ret;
}
if (endpoints[url].cors_policy == ALLOW_ALL_ORIGINS) {
MHD_add_response_header(response, "Access-Control-Allow-Origin", "*");
}
- int ret = MHD_queue_response(connection, MHD_HTTP_OK, response);
+ MHD_Result ret = MHD_queue_response(connection, MHD_HTTP_OK, response);
MHD_destroy_response(response); // Only decreases the refcount; actual free is after the request is done.
return ret;
}
MHD_Response *response = MHD_create_response_from_buffer(
contents.size(), &contents[0], MHD_RESPMEM_MUST_COPY);
MHD_add_response_header(response, "Content-type", "text/plain");
- int ret = MHD_queue_response(connection, MHD_HTTP_NOT_FOUND, response);
+ MHD_Result ret = MHD_queue_response(connection, MHD_HTTP_NOT_FOUND, response);
MHD_destroy_response(response); // Only decreases the refcount; actual free is after the request is done.
return ret;
}
MHD_add_response_header(response, "Content-encoding", "metacube");
}
- int ret = MHD_queue_response(connection, MHD_HTTP_OK, response);
+ MHD_Result ret = MHD_queue_response(connection, MHD_HTTP_OK, response);
MHD_destroy_response(response); // Only decreases the refcount; actual free is after the request is done.
return ret;