aboutsummaryrefslogtreecommitdiff
path: root/src/namestore/plugin_rest_namestore.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/namestore/plugin_rest_namestore.c')
-rw-r--r--src/namestore/plugin_rest_namestore.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/namestore/plugin_rest_namestore.c b/src/namestore/plugin_rest_namestore.c
index a3938cfd8..cfebd63a7 100644
--- a/src/namestore/plugin_rest_namestore.c
+++ b/src/namestore/plugin_rest_namestore.c
@@ -82,12 +82,12 @@ struct RecordEntry
82 * DLL 82 * DLL
83 */ 83 */
84 struct RecordEntry *next; 84 struct RecordEntry *next;
85 85
86 /** 86 /**
87 * DLL 87 * DLL
88 */ 88 */
89 struct RecordEntry *prev; 89 struct RecordEntry *prev;
90 90
91}; 91};
92 92
93struct RequestHandle 93struct RequestHandle
@@ -106,12 +106,12 @@ struct RequestHandle
106 * JSON response object 106 * JSON response object
107 */ 107 */
108 struct JsonApiObject *resp_object; 108 struct JsonApiObject *resp_object;
109 109
110 /** 110 /**
111 * Rest connection 111 * Rest connection
112 */ 112 */
113 struct RestConnectionDataHandle *conndata_handle; 113 struct RestConnectionDataHandle *conndata_handle;
114 114
115 /** 115 /**
116 * Handle to GNS service. 116 * Handle to GNS service.
117 */ 117 */
@@ -121,12 +121,12 @@ struct RequestHandle
121 * Handle to NAMESTORE 121 * Handle to NAMESTORE
122 */ 122 */
123 struct GNUNET_NAMESTORE_Handle *ns_handle; 123 struct GNUNET_NAMESTORE_Handle *ns_handle;
124 124
125 /** 125 /**
126 * Handle to NAMESTORE it 126 * Handle to NAMESTORE it
127 */ 127 */
128 struct GNUNET_NAMESTORE_ZoneIterator *list_it; 128 struct GNUNET_NAMESTORE_ZoneIterator *list_it;
129 129
130 /** 130 /**
131 * Private key for the zone 131 * Private key for the zone
132 */ 132 */
@@ -205,7 +205,7 @@ struct RequestHandle
205 /** 205 /**
206 * ID of a task associated with the resolution process. 206 * ID of a task associated with the resolution process.
207 */ 207 */
208 struct GNUNET_SCHEDULER_Task * timeout_task; 208 struct GNUNET_SCHEDULER_Task * timeout_task;
209 209
210 /** 210 /**
211 * The plugin result processor 211 * The plugin result processor
@@ -353,25 +353,25 @@ gnsrecord_to_json (const struct GNUNET_GNSRECORD_Data *rd)
353 * Task run on shutdown. Cleans up everything. 353 * Task run on shutdown. Cleans up everything.
354 * 354 *
355 * @param cls unused 355 * @param cls unused
356 * @param tc scheduler context
357 */ 356 */
358static void 357static void
359do_error (void *cls, 358do_error (void *cls)
360 const struct GNUNET_SCHEDULER_TaskContext *tc)
361{ 359{
362 struct RequestHandle *handle = cls; 360 struct RequestHandle *handle = cls;
363 struct MHD_Response *resp = GNUNET_REST_create_json_response (NULL); 361 struct MHD_Response *resp = GNUNET_REST_create_json_response (NULL);
362
364 handle->proc (handle->proc_cls, resp, MHD_HTTP_BAD_REQUEST); 363 handle->proc (handle->proc_cls, resp, MHD_HTTP_BAD_REQUEST);
365 cleanup_handle (handle); 364 cleanup_handle (handle);
366} 365}
367 366
367
368static void 368static void
369cleanup_handle_delayed (void *cls, 369cleanup_handle_delayed (void *cls)
370 const struct GNUNET_SCHEDULER_TaskContext *tc)
371{ 370{
372 cleanup_handle (cls); 371 cleanup_handle (cls);
373} 372}
374 373
374
375/** 375/**
376 * Create a response with requested records 376 * Create a response with requested records
377 * 377 *
@@ -688,7 +688,7 @@ json_to_gnsrecord (const json_t *records_json,
688 { 688 {
689 (*rd)[i].expiration_time = etime_abs.abs_value_us; 689 (*rd)[i].expiration_time = etime_abs.abs_value_us;
690 } 690 }
691 else 691 else
692 { 692 {
693 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Value `%s' invalid for record type `%s'\n"), 693 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Value `%s' invalid for record type `%s'\n"),
694 value, typestring); 694 value, typestring);
@@ -760,7 +760,7 @@ namestore_create_cont (struct RestConnectionDataHandle *con,
760 { 760 {
761 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 761 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
762 "Name property is no string\n"); 762 "Name property is no string\n");
763 GNUNET_REST_jsonapi_object_delete (json_obj); 763 GNUNET_REST_jsonapi_object_delete (json_obj);
764 GNUNET_SCHEDULER_add_now (&do_error, handle); 764 GNUNET_SCHEDULER_add_now (&do_error, handle);
765 return; 765 return;
766 } 766 }
@@ -844,7 +844,7 @@ namestore_zkey_cont (struct RestConnectionDataHandle *con,
844 GNUNET_CRYPTO_hash (GNUNET_REST_JSONAPI_NAMESTORE_ZKEY, 844 GNUNET_CRYPTO_hash (GNUNET_REST_JSONAPI_NAMESTORE_ZKEY,
845 strlen (GNUNET_REST_JSONAPI_NAMESTORE_ZKEY), 845 strlen (GNUNET_REST_JSONAPI_NAMESTORE_ZKEY),
846 &key); 846 &key);
847 if ( GNUNET_NO == 847 if ( GNUNET_NO ==
848 GNUNET_CONTAINER_multihashmap_contains (handle->conndata_handle->url_param_map, 848 GNUNET_CONTAINER_multihashmap_contains (handle->conndata_handle->url_param_map,
849 &key) ) 849 &key) )
850 { 850 {
@@ -1058,7 +1058,7 @@ testservice_id_task (void *cls, int result)
1058 GNUNET_CRYPTO_hash (GNUNET_REST_JSONAPI_NAMESTORE_EGO, 1058 GNUNET_CRYPTO_hash (GNUNET_REST_JSONAPI_NAMESTORE_EGO,
1059 strlen (GNUNET_REST_JSONAPI_NAMESTORE_EGO), 1059 strlen (GNUNET_REST_JSONAPI_NAMESTORE_EGO),
1060 &key); 1060 &key);
1061 if ( GNUNET_YES == 1061 if ( GNUNET_YES ==
1062 GNUNET_CONTAINER_multihashmap_contains (handle->conndata_handle->url_param_map, 1062 GNUNET_CONTAINER_multihashmap_contains (handle->conndata_handle->url_param_map,
1063 &key) ) 1063 &key) )
1064 { 1064 {
@@ -1070,7 +1070,7 @@ testservice_id_task (void *cls, int result)
1070 GNUNET_CRYPTO_hash (GNUNET_REST_JSONAPI_NAMESTORE_RECORD_TYPE, 1070 GNUNET_CRYPTO_hash (GNUNET_REST_JSONAPI_NAMESTORE_RECORD_TYPE,
1071 strlen (GNUNET_REST_JSONAPI_NAMESTORE_RECORD_TYPE), 1071 strlen (GNUNET_REST_JSONAPI_NAMESTORE_RECORD_TYPE),
1072 &key); 1072 &key);
1073 if ( GNUNET_YES == 1073 if ( GNUNET_YES ==
1074 GNUNET_CONTAINER_multihashmap_contains (handle->conndata_handle->url_param_map, 1074 GNUNET_CONTAINER_multihashmap_contains (handle->conndata_handle->url_param_map,
1075 &key) ) 1075 &key) )
1076 { 1076 {