X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Frest%2Frest.c;h=94803a30696f796069c45e97def080b90d6f71a2;hb=60790f6e89914decc21c850d07aef9be237a6c41;hp=a179553141b8bb979ac9398824f08fc0f13dcf82;hpb=bee208bcd6803829aa26c55a4c8e176a5f2c815f;p=oweals%2Fgnunet.git diff --git a/src/rest/rest.c b/src/rest/rest.c index a17955314..94803a306 100644 --- a/src/rest/rest.c +++ b/src/rest/rest.c @@ -28,7 +28,6 @@ #include "gnunet_util_lib.h" #include "gnunet_rest_lib.h" #include "microhttpd.h" -#include /** * REST Utilities @@ -48,13 +47,13 @@ GNUNET_REST_namespace_match (const char *url, const char *namespace) } /** - * Create JSON API MHD response + * Create MHD response * - * @param data JSON result + * @param data result * @retun MHD response */ struct MHD_Response* -GNUNET_REST_create_json_response (const char *data) +GNUNET_REST_create_response (const char *data) { struct MHD_Response *resp; size_t len; @@ -69,14 +68,14 @@ GNUNET_REST_create_json_response (const char *data) resp = MHD_create_response_from_buffer (len, (void*)data, MHD_RESPMEM_MUST_COPY); - MHD_add_response_header (resp,MHD_HTTP_HEADER_CONTENT_TYPE,"application/json"); return resp; } int -GNUNET_REST_handle_request (struct RestConnectionDataHandle *conn, - const struct GNUNET_REST_RestConnectionHandler *handlers, +GNUNET_REST_handle_request (struct GNUNET_REST_RequestHandle *conn, + const struct GNUNET_REST_RequestHandler *handlers, + struct GNUNET_REST_RequestHandlerError *err, void *cls) { int count; @@ -104,6 +103,7 @@ GNUNET_REST_handle_request (struct RestConnectionDataHandle *conn, return GNUNET_YES; } GNUNET_free (url); + err->error_code = MHD_HTTP_BAD_REQUEST; return GNUNET_NO; }