diff options
Diffstat (limited to 'src/rest/plugin_rest_config.c')
-rw-r--r-- | src/rest/plugin_rest_config.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/rest/plugin_rest_config.c b/src/rest/plugin_rest_config.c index af833efff..b0f18754c 100644 --- a/src/rest/plugin_rest_config.c +++ b/src/rest/plugin_rest_config.c | |||
@@ -91,7 +91,6 @@ static struct RequestHandle *requests_head; | |||
91 | static struct RequestHandle *requests_tail; | 91 | static struct RequestHandle *requests_tail; |
92 | 92 | ||
93 | 93 | ||
94 | |||
95 | /** | 94 | /** |
96 | * Cleanup request handle. | 95 | * Cleanup request handle. |
97 | * | 96 | * |
@@ -199,7 +198,9 @@ get_cont (struct GNUNET_REST_RequestHandle *con_handle, | |||
199 | } | 198 | } |
200 | response = json_dumps (result, 0); | 199 | response = json_dumps (result, 0); |
201 | resp = GNUNET_REST_create_response (response); | 200 | resp = GNUNET_REST_create_response (response); |
202 | MHD_add_response_header (resp, "Content-Type", "application/json"); | 201 | GNUNET_assert (MHD_NO != MHD_add_response_header (resp, |
202 | "Content-Type", | ||
203 | "application/json")); | ||
203 | handle->proc (handle->proc_cls, resp, MHD_HTTP_OK); | 204 | handle->proc (handle->proc_cls, resp, MHD_HTTP_OK); |
204 | cleanup_handle (handle); | 205 | cleanup_handle (handle); |
205 | GNUNET_free (response); | 206 | GNUNET_free (response); |
@@ -334,6 +335,7 @@ set_cont (struct GNUNET_REST_RequestHandle *con_handle, | |||
334 | handle->proc (handle->proc_cls, | 335 | handle->proc (handle->proc_cls, |
335 | GNUNET_REST_create_response (NULL), | 336 | GNUNET_REST_create_response (NULL), |
336 | MHD_HTTP_OK); | 337 | MHD_HTTP_OK); |
338 | GNUNET_free (cfg_fn); | ||
337 | cleanup_handle (handle); | 339 | cleanup_handle (handle); |
338 | } | 340 | } |
339 | 341 | ||
@@ -352,9 +354,9 @@ options_cont (struct GNUNET_REST_RequestHandle *con_handle, | |||
352 | struct RequestHandle *handle = cls; | 354 | struct RequestHandle *handle = cls; |
353 | 355 | ||
354 | resp = GNUNET_REST_create_response (NULL); | 356 | resp = GNUNET_REST_create_response (NULL); |
355 | MHD_add_response_header (resp, | 357 | GNUNET_assert (MHD_NO != MHD_add_response_header (resp, |
356 | "Access-Control-Allow-Methods", | 358 | "Access-Control-Allow-Methods", |
357 | MHD_HTTP_METHOD_GET); | 359 | MHD_HTTP_METHOD_GET)); |
358 | handle->proc (handle->proc_cls, resp, MHD_HTTP_OK); | 360 | handle->proc (handle->proc_cls, resp, MHD_HTTP_OK); |
359 | cleanup_handle (handle); | 361 | cleanup_handle (handle); |
360 | } | 362 | } |
@@ -424,7 +426,7 @@ libgnunet_plugin_rest_config_init (void *cls) | |||
424 | api->cls = &plugin; | 426 | api->cls = &plugin; |
425 | api->name = GNUNET_REST_API_NS_CONFIG; | 427 | api->name = GNUNET_REST_API_NS_CONFIG; |
426 | api->process_request = &rest_config_process_request; | 428 | api->process_request = &rest_config_process_request; |
427 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("CONFIG REST API initialized\n")); | 429 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, _ ("CONFIG REST API initialized\n")); |
428 | return api; | 430 | return api; |
429 | } | 431 | } |
430 | 432 | ||