aboutsummaryrefslogtreecommitdiff
path: root/src/identity/plugin_rest_identity.c
diff options
context:
space:
mode:
authorMartin Schanzenbach <mschanzenbach@posteo.de>2016-06-18 18:16:22 +0000
committerMartin Schanzenbach <mschanzenbach@posteo.de>2016-06-18 18:16:22 +0000
commit5dfc382a9f8467cd15b6a0c3a6e022fca9fc4a30 (patch)
tree5d285afb370bb3d5800c3541a20760ab3db845d6 /src/identity/plugin_rest_identity.c
parentd3ba7a63bb47299d70fe7895e5df9a523607492e (diff)
downloadgnunet-5dfc382a9f8467cd15b6a0c3a6e022fca9fc4a30.tar.gz
gnunet-5dfc382a9f8467cd15b6a0c3a6e022fca9fc4a30.zip
- fix rest plugin
Diffstat (limited to 'src/identity/plugin_rest_identity.c')
-rw-r--r--src/identity/plugin_rest_identity.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/identity/plugin_rest_identity.c b/src/identity/plugin_rest_identity.c
index f14c80f42..44e754e6c 100644
--- a/src/identity/plugin_rest_identity.c
+++ b/src/identity/plugin_rest_identity.c
@@ -279,7 +279,7 @@ do_error (void *cls)
279 "{Error while processing request: %s}", 279 "{Error while processing request: %s}",
280 &handle->emsg); 280 &handle->emsg);
281 281
282 resp = GNUNET_REST_create_json_response (json_error); 282 resp = GNUNET_REST_create_response (json_error);
283 handle->proc (handle->proc_cls, 283 handle->proc (handle->proc_cls,
284 resp, 284 resp,
285 handle->response_code); 285 handle->response_code);
@@ -339,7 +339,7 @@ get_ego_for_subsys (void *cls,
339 } 339 }
340 GNUNET_JSONAPI_document_serialize (json_document, &result_str); 340 GNUNET_JSONAPI_document_serialize (json_document, &result_str);
341 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Result %s\n", result_str); 341 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Result %s\n", result_str);
342 resp = GNUNET_REST_create_json_response (result_str); 342 resp = GNUNET_REST_create_response (result_str);
343 GNUNET_JSONAPI_document_delete (json_document); 343 GNUNET_JSONAPI_document_delete (json_document);
344 handle->proc (handle->proc_cls, resp, MHD_HTTP_OK); 344 handle->proc (handle->proc_cls, resp, MHD_HTTP_OK);
345 GNUNET_free (result_str); 345 GNUNET_free (result_str);
@@ -372,7 +372,7 @@ ego_info_response (struct GNUNET_REST_RequestHandle *con,
372 372
373 if (GNUNET_NO == GNUNET_REST_namespace_match (handle->url, GNUNET_REST_API_NS_IDENTITY)) 373 if (GNUNET_NO == GNUNET_REST_namespace_match (handle->url, GNUNET_REST_API_NS_IDENTITY))
374 { 374 {
375 resp = GNUNET_REST_create_json_response (NULL); 375 resp = GNUNET_REST_create_response (NULL);
376 handle->proc (handle->proc_cls, resp, MHD_HTTP_BAD_REQUEST); 376 handle->proc (handle->proc_cls, resp, MHD_HTTP_BAD_REQUEST);
377 cleanup_handle (handle); 377 cleanup_handle (handle);
378 return; 378 return;
@@ -444,7 +444,7 @@ ego_info_response (struct GNUNET_REST_RequestHandle *con,
444 } 444 }
445 GNUNET_JSONAPI_document_serialize (json_document, &result_str); 445 GNUNET_JSONAPI_document_serialize (json_document, &result_str);
446 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Result %s\n", result_str); 446 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Result %s\n", result_str);
447 resp = GNUNET_REST_create_json_response (result_str); 447 resp = GNUNET_REST_create_response (result_str);
448 GNUNET_JSONAPI_document_delete (json_document); 448 GNUNET_JSONAPI_document_delete (json_document);
449 handle->proc (handle->proc_cls, resp, MHD_HTTP_OK); 449 handle->proc (handle->proc_cls, resp, MHD_HTTP_OK);
450 GNUNET_free (result_str); 450 GNUNET_free (result_str);
@@ -470,7 +470,7 @@ do_finished (void *cls, const char *emsg)
470 GNUNET_SCHEDULER_add_now (&do_error, handle); 470 GNUNET_SCHEDULER_add_now (&do_error, handle);
471 return; 471 return;
472 } 472 }
473 resp = GNUNET_REST_create_json_response (NULL); 473 resp = GNUNET_REST_create_response (NULL);
474 handle->proc (handle->proc_cls, resp, MHD_HTTP_NO_CONTENT); 474 handle->proc (handle->proc_cls, resp, MHD_HTTP_NO_CONTENT);
475 cleanup_handle (handle); 475 cleanup_handle (handle);
476} 476}
@@ -528,7 +528,7 @@ ego_create_cont (struct GNUNET_REST_RequestHandle *con,
528 if (GNUNET_NO == GNUNET_JSONAPI_resource_check_type (json_res, GNUNET_REST_JSONAPI_IDENTITY_EGO)) 528 if (GNUNET_NO == GNUNET_JSONAPI_resource_check_type (json_res, GNUNET_REST_JSONAPI_IDENTITY_EGO))
529 { 529 {
530 GNUNET_JSONAPI_document_delete (json_obj); 530 GNUNET_JSONAPI_document_delete (json_obj);
531 resp = GNUNET_REST_create_json_response (NULL); 531 resp = GNUNET_REST_create_response (NULL);
532 handle->proc (handle->proc_cls, resp, MHD_HTTP_CONFLICT); 532 handle->proc (handle->proc_cls, resp, MHD_HTTP_CONFLICT);
533 cleanup_handle (handle); 533 cleanup_handle (handle);
534 return; 534 return;
@@ -549,7 +549,7 @@ ego_create_cont (struct GNUNET_REST_RequestHandle *con,
549 if (0 == strcasecmp (egoname, ego_entry->identifier)) 549 if (0 == strcasecmp (egoname, ego_entry->identifier))
550 { 550 {
551 GNUNET_JSONAPI_document_delete (json_obj); 551 GNUNET_JSONAPI_document_delete (json_obj);
552 resp = GNUNET_REST_create_json_response (NULL); 552 resp = GNUNET_REST_create_response (NULL);
553 handle->proc (handle->proc_cls, resp, MHD_HTTP_CONFLICT); 553 handle->proc (handle->proc_cls, resp, MHD_HTTP_CONFLICT);
554 cleanup_handle (handle); 554 cleanup_handle (handle);
555 return; 555 return;
@@ -610,7 +610,7 @@ ego_edit_cont (struct GNUNET_REST_RequestHandle *con,
610 610
611 if (GNUNET_NO == ego_exists) 611 if (GNUNET_NO == ego_exists)
612 { 612 {
613 resp = GNUNET_REST_create_json_response (NULL); 613 resp = GNUNET_REST_create_response (NULL);
614 handle->proc (handle->proc_cls, resp, MHD_HTTP_NOT_FOUND); 614 handle->proc (handle->proc_cls, resp, MHD_HTTP_NOT_FOUND);
615 cleanup_handle (handle); 615 cleanup_handle (handle);
616 return; 616 return;
@@ -667,7 +667,7 @@ ego_edit_cont (struct GNUNET_REST_RequestHandle *con,
667 { 667 {
668 //Ego with same name not allowed 668 //Ego with same name not allowed
669 GNUNET_JSONAPI_document_delete (json_obj); 669 GNUNET_JSONAPI_document_delete (json_obj);
670 resp = GNUNET_REST_create_json_response (NULL); 670 resp = GNUNET_REST_create_response (NULL);
671 handle->proc (handle->proc_cls, resp, MHD_HTTP_CONFLICT); 671 handle->proc (handle->proc_cls, resp, MHD_HTTP_CONFLICT);
672 cleanup_handle (handle); 672 cleanup_handle (handle);
673 return; 673 return;
@@ -731,7 +731,7 @@ ego_delete_cont (struct GNUNET_REST_RequestHandle *con_handle,
731 } 731 }
732 if (GNUNET_NO == ego_exists) 732 if (GNUNET_NO == ego_exists)
733 { 733 {
734 resp = GNUNET_REST_create_json_response (NULL); 734 resp = GNUNET_REST_create_response (NULL);
735 handle->proc (handle->proc_cls, resp, MHD_HTTP_NOT_FOUND); 735 handle->proc (handle->proc_cls, resp, MHD_HTTP_NOT_FOUND);
736 cleanup_handle (handle); 736 cleanup_handle (handle);
737 return; 737 return;
@@ -760,7 +760,7 @@ options_cont (struct GNUNET_REST_RequestHandle *con_handle,
760 struct RequestHandle *handle = cls; 760 struct RequestHandle *handle = cls;
761 761
762 //For now, independent of path return all options 762 //For now, independent of path return all options
763 resp = GNUNET_REST_create_json_response (NULL); 763 resp = GNUNET_REST_create_response (NULL);
764 MHD_add_response_header (resp, 764 MHD_add_response_header (resp,
765 "Access-Control-Allow-Methods", 765 "Access-Control-Allow-Methods",
766 allow_methods); 766 allow_methods);