diff options
author | Schanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de> | 2018-08-09 23:51:46 +0200 |
---|---|---|
committer | Schanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de> | 2018-08-09 23:51:46 +0200 |
commit | 1ad7b69834fffc95e05354983009e435030c0861 (patch) | |
tree | 0e76a096cb5e27beaa582ac29ec57f0edf2e814a /src | |
parent | e083dd6ae0b96f30328d0d54bc7a55f6cd34b2b4 (diff) | |
download | gnunet-1ad7b69834fffc95e05354983009e435030c0861.tar.gz gnunet-1ad7b69834fffc95e05354983009e435030c0861.zip |
style
Diffstat (limited to 'src')
-rw-r--r-- | src/gns/plugin_rest_gns.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/gns/plugin_rest_gns.c b/src/gns/plugin_rest_gns.c index 41b855743..fd2469577 100644 --- a/src/gns/plugin_rest_gns.c +++ b/src/gns/plugin_rest_gns.c | |||
@@ -200,7 +200,7 @@ do_error (void *cls) | |||
200 | */ | 200 | */ |
201 | static void | 201 | static void |
202 | handle_gns_response (void *cls, | 202 | handle_gns_response (void *cls, |
203 | int was_gns, | 203 | int was_gns, |
204 | uint32_t rd_count, | 204 | uint32_t rd_count, |
205 | const struct GNUNET_GNSRECORD_Data *rd) | 205 | const struct GNUNET_GNSRECORD_Data *rd) |
206 | { | 206 | { |
@@ -223,7 +223,7 @@ handle_gns_response (void *cls, | |||
223 | for (uint32_t i=0;i<rd_count;i++) | 223 | for (uint32_t i=0;i<rd_count;i++) |
224 | { | 224 | { |
225 | if ((rd[i].record_type != handle->record_type) && | 225 | if ((rd[i].record_type != handle->record_type) && |
226 | (GNUNET_GNSRECORD_TYPE_ANY != handle->record_type) ) | 226 | (GNUNET_GNSRECORD_TYPE_ANY != handle->record_type) ) |
227 | { | 227 | { |
228 | continue; | 228 | continue; |
229 | } | 229 | } |
@@ -252,8 +252,8 @@ handle_gns_response (void *cls, | |||
252 | */ | 252 | */ |
253 | void | 253 | void |
254 | get_gns_cont (struct GNUNET_REST_RequestHandle *con_handle, | 254 | get_gns_cont (struct GNUNET_REST_RequestHandle *con_handle, |
255 | const char* url, | 255 | const char* url, |
256 | void *cls) | 256 | void *cls) |
257 | { | 257 | { |
258 | struct RequestHandle *handle = cls; | 258 | struct RequestHandle *handle = cls; |
259 | struct GNUNET_HashCode key; | 259 | struct GNUNET_HashCode key; |
@@ -261,11 +261,11 @@ get_gns_cont (struct GNUNET_REST_RequestHandle *con_handle, | |||
261 | char *name; | 261 | char *name; |
262 | 262 | ||
263 | GNUNET_CRYPTO_hash (GNUNET_REST_GNS_PARAM_NAME, | 263 | GNUNET_CRYPTO_hash (GNUNET_REST_GNS_PARAM_NAME, |
264 | strlen (GNUNET_REST_GNS_PARAM_NAME), | 264 | strlen (GNUNET_REST_GNS_PARAM_NAME), |
265 | &key); | 265 | &key); |
266 | if ( GNUNET_NO | 266 | if ( GNUNET_NO |
267 | == GNUNET_CONTAINER_multihashmap_contains (con_handle->url_param_map, | 267 | == GNUNET_CONTAINER_multihashmap_contains (con_handle->url_param_map, |
268 | &key)) | 268 | &key)) |
269 | { | 269 | { |
270 | handle->emsg = GNUNET_strdup("Parameter name is missing"); | 270 | handle->emsg = GNUNET_strdup("Parameter name is missing"); |
271 | GNUNET_SCHEDULER_add_now (&do_error, handle); | 271 | GNUNET_SCHEDULER_add_now (&do_error, handle); |
@@ -282,11 +282,11 @@ get_gns_cont (struct GNUNET_REST_RequestHandle *con_handle, | |||
282 | 282 | ||
283 | handle->record_type = UINT32_MAX; | 283 | handle->record_type = UINT32_MAX; |
284 | GNUNET_CRYPTO_hash (GNUNET_REST_GNS_PARAM_RECORD_TYPE, | 284 | GNUNET_CRYPTO_hash (GNUNET_REST_GNS_PARAM_RECORD_TYPE, |
285 | strlen (GNUNET_REST_GNS_PARAM_RECORD_TYPE), | 285 | strlen (GNUNET_REST_GNS_PARAM_RECORD_TYPE), |
286 | &key); | 286 | &key); |
287 | if ( GNUNET_YES | 287 | if ( GNUNET_YES |
288 | == GNUNET_CONTAINER_multihashmap_contains (con_handle->url_param_map, | 288 | == GNUNET_CONTAINER_multihashmap_contains (con_handle->url_param_map, |
289 | &key)) | 289 | &key)) |
290 | { | 290 | { |
291 | record_type = GNUNET_CONTAINER_multihashmap_get (con_handle->url_param_map, &key); | 291 | record_type = GNUNET_CONTAINER_multihashmap_get (con_handle->url_param_map, &key); |
292 | handle->record_type = GNUNET_GNSRECORD_typename_to_number(record_type); | 292 | handle->record_type = GNUNET_GNSRECORD_typename_to_number(record_type); |
@@ -307,11 +307,11 @@ get_gns_cont (struct GNUNET_REST_RequestHandle *con_handle, | |||
307 | } | 307 | } |
308 | 308 | ||
309 | handle->gns_lookup = GNUNET_GNS_lookup_with_tld (handle->gns, | 309 | handle->gns_lookup = GNUNET_GNS_lookup_with_tld (handle->gns, |
310 | handle->name, | 310 | handle->name, |
311 | handle->record_type, | 311 | handle->record_type, |
312 | GNUNET_NO, | 312 | GNUNET_NO, |
313 | &handle_gns_response, | 313 | &handle_gns_response, |
314 | handle); | 314 | handle); |
315 | return; | 315 | return; |
316 | } | 316 | } |
317 | 317 | ||
@@ -382,17 +382,17 @@ init_cont (struct RequestHandle *handle) | |||
382 | */ | 382 | */ |
383 | static void | 383 | static void |
384 | rest_process_request(struct GNUNET_REST_RequestHandle *rest_handle, | 384 | rest_process_request(struct GNUNET_REST_RequestHandle *rest_handle, |
385 | GNUNET_REST_ResultProcessor proc, | 385 | GNUNET_REST_ResultProcessor proc, |
386 | void *proc_cls) | 386 | void *proc_cls) |
387 | { | 387 | { |
388 | struct RequestHandle *handle = GNUNET_new (struct RequestHandle); | 388 | struct RequestHandle *handle = GNUNET_new (struct RequestHandle); |
389 | 389 | ||
390 | handle->response_code = 0; | 390 | handle->response_code = 0; |
391 | handle->timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60); | 391 | handle->timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60); |
392 | handle->proc_cls = proc_cls; | 392 | handle->proc_cls = proc_cls; |
393 | handle->proc = proc; | 393 | handle->proc = proc; |
394 | handle->rest_handle = rest_handle; | 394 | handle->rest_handle = rest_handle; |
395 | 395 | ||
396 | handle->url = GNUNET_strdup (rest_handle->url); | 396 | handle->url = GNUNET_strdup (rest_handle->url); |
397 | if (handle->url[strlen (handle->url)-1] == '/') | 397 | if (handle->url[strlen (handle->url)-1] == '/') |
398 | handle->url[strlen (handle->url)-1] = '\0'; | 398 | handle->url[strlen (handle->url)-1] = '\0'; |
@@ -404,7 +404,7 @@ rest_process_request(struct GNUNET_REST_RequestHandle *rest_handle, | |||
404 | GNUNET_SCHEDULER_add_delayed (handle->timeout, | 404 | GNUNET_SCHEDULER_add_delayed (handle->timeout, |
405 | &do_error, | 405 | &do_error, |
406 | handle); | 406 | handle); |
407 | 407 | ||
408 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connected\n"); | 408 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connected\n"); |
409 | } | 409 | } |
410 | 410 | ||