diff options
author | Martin Schanzenbach <mschanzenbach@posteo.de> | 2021-08-09 12:49:56 +0200 |
---|---|---|
committer | Martin Schanzenbach <mschanzenbach@posteo.de> | 2021-08-09 12:49:56 +0200 |
commit | 576fce82f4275975e03ab6a114a1f5b86cdf8b9c (patch) | |
tree | cf378332fa8a64bb0b5afbf7596c09ca5530c270 /src/rest/plugin_rest_config.c | |
parent | caf4a91464e0aec32a9f62a14a45b25829b03a70 (diff) | |
download | gnunet-576fce82f4275975e03ab6a114a1f5b86cdf8b9c.tar.gz gnunet-576fce82f4275975e03ab6a114a1f5b86cdf8b9c.zip |
-coverity
Diffstat (limited to 'src/rest/plugin_rest_config.c')
-rw-r--r-- | src/rest/plugin_rest_config.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/rest/plugin_rest_config.c b/src/rest/plugin_rest_config.c index 8269a4662..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); |
@@ -353,9 +354,9 @@ options_cont (struct GNUNET_REST_RequestHandle *con_handle, | |||
353 | struct RequestHandle *handle = cls; | 354 | struct RequestHandle *handle = cls; |
354 | 355 | ||
355 | resp = GNUNET_REST_create_response (NULL); | 356 | resp = GNUNET_REST_create_response (NULL); |
356 | MHD_add_response_header (resp, | 357 | GNUNET_assert (MHD_NO != MHD_add_response_header (resp, |
357 | "Access-Control-Allow-Methods", | 358 | "Access-Control-Allow-Methods", |
358 | MHD_HTTP_METHOD_GET); | 359 | MHD_HTTP_METHOD_GET)); |
359 | handle->proc (handle->proc_cls, resp, MHD_HTTP_OK); | 360 | handle->proc (handle->proc_cls, resp, MHD_HTTP_OK); |
360 | cleanup_handle (handle); | 361 | cleanup_handle (handle); |
361 | } | 362 | } |
@@ -425,7 +426,7 @@ libgnunet_plugin_rest_config_init (void *cls) | |||
425 | api->cls = &plugin; | 426 | api->cls = &plugin; |
426 | api->name = GNUNET_REST_API_NS_CONFIG; | 427 | api->name = GNUNET_REST_API_NS_CONFIG; |
427 | api->process_request = &rest_config_process_request; | 428 | api->process_request = &rest_config_process_request; |
428 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("CONFIG REST API initialized\n")); | 429 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, _ ("CONFIG REST API initialized\n")); |
429 | return api; | 430 | return api; |
430 | } | 431 | } |
431 | 432 | ||