diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-04-09 23:14:03 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-04-09 23:14:03 +0000 |
commit | 29e6158507a0758192075ac6ece7ba8e75ddc49a (patch) | |
tree | b91ded48da322f8ba4c9bb0f5504228aa036c2d1 /src/identity/plugin_rest_identity.c | |
parent | 5dfcb058ab5db9ae0c4b147d8a99c64ca0980028 (diff) | |
download | gnunet-29e6158507a0758192075ac6ece7ba8e75ddc49a.tar.gz gnunet-29e6158507a0758192075ac6ece7ba8e75ddc49a.zip |
small API change: do no longer pass rarely needed GNUNET_SCHEDULER_TaskContext to all scheduler tasks; instead, allow the relatively few tasks that need it to obtain the context via GNUNET_SCHEDULER_get_task_context()
Diffstat (limited to 'src/identity/plugin_rest_identity.c')
-rw-r--r-- | src/identity/plugin_rest_identity.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/identity/plugin_rest_identity.c b/src/identity/plugin_rest_identity.c index 9ab3a8772..22ade6a0e 100644 --- a/src/identity/plugin_rest_identity.c +++ b/src/identity/plugin_rest_identity.c | |||
@@ -107,12 +107,12 @@ struct EgoEntry | |||
107 | * DLL | 107 | * DLL |
108 | */ | 108 | */ |
109 | struct EgoEntry *next; | 109 | struct EgoEntry *next; |
110 | 110 | ||
111 | /** | 111 | /** |
112 | * DLL | 112 | * DLL |
113 | */ | 113 | */ |
114 | struct EgoEntry *prev; | 114 | struct EgoEntry *prev; |
115 | 115 | ||
116 | /** | 116 | /** |
117 | * Ego Identifier | 117 | * Ego Identifier |
118 | */ | 118 | */ |
@@ -122,7 +122,7 @@ struct EgoEntry | |||
122 | * Public key string | 122 | * Public key string |
123 | */ | 123 | */ |
124 | char *keystring; | 124 | char *keystring; |
125 | 125 | ||
126 | /** | 126 | /** |
127 | * The Ego | 127 | * The Ego |
128 | */ | 128 | */ |
@@ -146,7 +146,7 @@ struct RequestHandle | |||
146 | * Handle to the rest connection | 146 | * Handle to the rest connection |
147 | */ | 147 | */ |
148 | struct RestConnectionDataHandle *conndata_handle; | 148 | struct RestConnectionDataHandle *conndata_handle; |
149 | 149 | ||
150 | /** | 150 | /** |
151 | * The processing state | 151 | * The processing state |
152 | */ | 152 | */ |
@@ -170,7 +170,7 @@ struct RequestHandle | |||
170 | /** | 170 | /** |
171 | * ID of a task associated with the resolution process. | 171 | * ID of a task associated with the resolution process. |
172 | */ | 172 | */ |
173 | struct GNUNET_SCHEDULER_Task * timeout_task; | 173 | struct GNUNET_SCHEDULER_Task * timeout_task; |
174 | 174 | ||
175 | /** | 175 | /** |
176 | * The plugin result processor | 176 | * The plugin result processor |
@@ -260,11 +260,9 @@ cleanup_handle (struct RequestHandle *handle) | |||
260 | * Task run on shutdown. Cleans up everything. | 260 | * Task run on shutdown. Cleans up everything. |
261 | * | 261 | * |
262 | * @param cls unused | 262 | * @param cls unused |
263 | * @param tc scheduler context | ||
264 | */ | 263 | */ |
265 | static void | 264 | static void |
266 | do_error (void *cls, | 265 | do_error (void *cls) |
267 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
268 | { | 266 | { |
269 | struct RequestHandle *handle = cls; | 267 | struct RequestHandle *handle = cls; |
270 | struct MHD_Response *resp; | 268 | struct MHD_Response *resp; |
@@ -528,7 +526,7 @@ ego_create_cont (struct RestConnectionDataHandle *con, | |||
528 | egoname_json = GNUNET_REST_jsonapi_resource_read_attr (json_res, GNUNET_REST_JSONAPI_IDENTITY_NAME); | 526 | egoname_json = GNUNET_REST_jsonapi_resource_read_attr (json_res, GNUNET_REST_JSONAPI_IDENTITY_NAME); |
529 | if (!json_is_string (egoname_json)) | 527 | if (!json_is_string (egoname_json)) |
530 | { | 528 | { |
531 | GNUNET_REST_jsonapi_object_delete (json_obj); | 529 | GNUNET_REST_jsonapi_object_delete (json_obj); |
532 | handle->emsg = GNUNET_strdup ("No name provided"); | 530 | handle->emsg = GNUNET_strdup ("No name provided"); |
533 | GNUNET_SCHEDULER_add_now (&do_error, handle); | 531 | GNUNET_SCHEDULER_add_now (&do_error, handle); |
534 | return; | 532 | return; |
@@ -563,7 +561,7 @@ ego_create_cont (struct RestConnectionDataHandle *con, | |||
563 | * @param url the url that is requested | 561 | * @param url the url that is requested |
564 | * @param cls the RequestHandle | 562 | * @param cls the RequestHandle |
565 | */ | 563 | */ |
566 | static void | 564 | static void |
567 | ego_edit_cont (struct RestConnectionDataHandle *con, | 565 | ego_edit_cont (struct RestConnectionDataHandle *con, |
568 | const char *url, | 566 | const char *url, |
569 | void *cls) | 567 | void *cls) |
@@ -633,7 +631,7 @@ ego_edit_cont (struct RestConnectionDataHandle *con, | |||
633 | GNUNET_SCHEDULER_add_now (&do_error, handle); | 631 | GNUNET_SCHEDULER_add_now (&do_error, handle); |
634 | return; | 632 | return; |
635 | } | 633 | } |
636 | json_res = GNUNET_REST_jsonapi_object_get_resource (json_obj, 0); | 634 | json_res = GNUNET_REST_jsonapi_object_get_resource (json_obj, 0); |
637 | 635 | ||
638 | if (GNUNET_NO == GNUNET_REST_jsonapi_resource_check_type (json_res, GNUNET_REST_JSONAPI_IDENTITY_EGO)) | 636 | if (GNUNET_NO == GNUNET_REST_jsonapi_resource_check_type (json_res, GNUNET_REST_JSONAPI_IDENTITY_EGO)) |
639 | { | 637 | { |
@@ -692,7 +690,7 @@ ego_edit_cont (struct RestConnectionDataHandle *con, | |||
692 | GNUNET_SCHEDULER_add_now (&do_error, handle); | 690 | GNUNET_SCHEDULER_add_now (&do_error, handle); |
693 | } | 691 | } |
694 | 692 | ||
695 | void | 693 | void |
696 | ego_delete_cont (struct RestConnectionDataHandle *con_handle, | 694 | ego_delete_cont (struct RestConnectionDataHandle *con_handle, |
697 | const char* url, | 695 | const char* url, |
698 | void *cls) | 696 | void *cls) |
@@ -836,7 +834,7 @@ list_ego (void *cls, | |||
836 | if (ID_REST_STATE_INIT == handle->state) { | 834 | if (ID_REST_STATE_INIT == handle->state) { |
837 | ego_entry = GNUNET_new (struct EgoEntry); | 835 | ego_entry = GNUNET_new (struct EgoEntry); |
838 | GNUNET_IDENTITY_ego_get_public_key (ego, &pk); | 836 | GNUNET_IDENTITY_ego_get_public_key (ego, &pk); |
839 | ego_entry->keystring = | 837 | ego_entry->keystring = |
840 | GNUNET_CRYPTO_ecdsa_public_key_to_string (&pk); | 838 | GNUNET_CRYPTO_ecdsa_public_key_to_string (&pk); |
841 | ego_entry->ego = ego; | 839 | ego_entry->ego = ego; |
842 | GNUNET_asprintf (&ego_entry->identifier, "%s", identifier); | 840 | GNUNET_asprintf (&ego_entry->identifier, "%s", identifier); |