aboutsummaryrefslogtreecommitdiff
path: root/src/statistics/gnunet-statistics.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/statistics/gnunet-statistics.c')
-rw-r--r--src/statistics/gnunet-statistics.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/statistics/gnunet-statistics.c b/src/statistics/gnunet-statistics.c
index e004a0f1c..ae99662c4 100644
--- a/src/statistics/gnunet-statistics.c
+++ b/src/statistics/gnunet-statistics.c
@@ -371,7 +371,6 @@ clean_node (void *cls)
371 if (num_nodes == num_nodes_ready_shutdown) 371 if (num_nodes == num_nodes_ready_shutdown)
372 { 372 {
373 GNUNET_array_grow (nodes, num_nodes, 0); 373 GNUNET_array_grow (nodes, num_nodes, 0);
374 GNUNET_CONTAINER_multihashmap_destroy (values);
375 } 374 }
376} 375}
377 376
@@ -384,7 +383,10 @@ clean_node (void *cls)
384static void 383static void
385print_finish (void *cls) 384print_finish (void *cls)
386{ 385{
387 GNUNET_CONTAINER_multihashmap_iterate (values, printer, NULL); 386 GNUNET_CONTAINER_multihashmap_iterate (values,
387 &printer,
388 NULL);
389 GNUNET_CONTAINER_multihashmap_destroy (values);
388 GNUNET_SCHEDULER_shutdown (); 390 GNUNET_SCHEDULER_shutdown ();
389} 391}
390 392
@@ -398,7 +400,8 @@ print_finish (void *cls)
398 * @param succes Whether statistics were obtained successfully. 400 * @param succes Whether statistics were obtained successfully.
399 */ 401 */
400static void 402static void
401continuation_print (void *cls, int success) 403continuation_print (void *cls,
404 int success)
402{ 405{
403 const unsigned index_node = *(unsigned *) cls; 406 const unsigned index_node = *(unsigned *) cls;
404 407
@@ -406,7 +409,9 @@ continuation_print (void *cls, int success)
406 if (GNUNET_OK != success) 409 if (GNUNET_OK != success)
407 { 410 {
408 if (NULL == remote_host) 411 if (NULL == remote_host)
409 fprintf (stderr, "%s", _ ("Failed to obtain statistics.\n")); 412 fprintf (stderr,
413 "%s",
414 _ ("Failed to obtain statistics.\n"));
410 else 415 else
411 fprintf (stderr, 416 fprintf (stderr,
412 _ ("Failed to obtain statistics from host `%s:%llu'\n"), 417 _ ("Failed to obtain statistics from host `%s:%llu'\n"),
@@ -419,11 +424,13 @@ continuation_print (void *cls, int success)
419 GNUNET_SCHEDULER_cancel (nodes[index_node].shutdown_task); 424 GNUNET_SCHEDULER_cancel (nodes[index_node].shutdown_task);
420 nodes[index_node].shutdown_task = NULL; 425 nodes[index_node].shutdown_task = NULL;
421 } 426 }
422 GNUNET_SCHEDULER_add_now (clean_node, &nodes[index_node].index_node); 427 GNUNET_SCHEDULER_add_now (&clean_node,
428 &nodes[index_node].index_node);
423 num_nodes_ready++; 429 num_nodes_ready++;
424 if (num_nodes_ready == num_nodes) 430 if (num_nodes_ready == num_nodes)
425 { 431 {
426 GNUNET_SCHEDULER_add_now (print_finish, NULL); 432 GNUNET_SCHEDULER_add_now (&print_finish,
433 NULL);
427 } 434 }
428} 435}
429 436