diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-09-20 02:28:01 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-09-20 02:28:01 +0000 |
commit | 6a131ab255bb3419eb0e59a24879556d5b1c75d3 (patch) | |
tree | 3d5a543eb36d2184fbc9d390ecd3c9e092614e13 /src/statistics/statistics_api.c | |
parent | 102ef991828f70f8a4baa9755be02e5a17a67110 (diff) | |
download | gnunet-6a131ab255bb3419eb0e59a24879556d5b1c75d3.tar.gz gnunet-6a131ab255bb3419eb0e59a24879556d5b1c75d3.zip |
convert statistics service to new service MQ API
Diffstat (limited to 'src/statistics/statistics_api.c')
-rw-r--r-- | src/statistics/statistics_api.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/statistics/statistics_api.c b/src/statistics/statistics_api.c index 856873d00..e8aa9cf9c 100644 --- a/src/statistics/statistics_api.c +++ b/src/statistics/statistics_api.c | |||
@@ -576,16 +576,16 @@ do_destroy (void *cls) | |||
576 | 576 | ||
577 | 577 | ||
578 | /** | 578 | /** |
579 | * Handle a #GNUNET_MESSAGE_TYPE_TEST (sic) message. We receive this | 579 | * Handle a #GNUNET_MESSAGE_TYPE_STATISTICS_DISCONNECT_CONFIRM |
580 | * message at the end of the shutdown when the service confirms that | 580 | * message. We receive this message at the end of the shutdown when |
581 | * all data has been written to disk. | 581 | * the service confirms that all data has been written to disk. |
582 | * | 582 | * |
583 | * @param cls our `struct GNUNET_STATISTICS_Handle *` | 583 | * @param cls our `struct GNUNET_STATISTICS_Handle *` |
584 | * @param msg the message | 584 | * @param msg the message |
585 | */ | 585 | */ |
586 | static void | 586 | static void |
587 | handle_test (void *cls, | 587 | handle_disconnect_confirm (void *cls, |
588 | const struct GNUNET_MessageHeader *msg) | 588 | const struct GNUNET_MessageHeader *msg) |
589 | { | 589 | { |
590 | struct GNUNET_STATISTICS_Handle *h = cls; | 590 | struct GNUNET_STATISTICS_Handle *h = cls; |
591 | 591 | ||
@@ -598,7 +598,7 @@ handle_test (void *cls, | |||
598 | return; | 598 | return; |
599 | } | 599 | } |
600 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 600 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
601 | "Received TEST message from statistics, can complete disconnect\n"); | 601 | "Received DISCONNNECT_CONFIRM message from statistics, can complete disconnect\n"); |
602 | if (NULL != h->destroy_task) | 602 | if (NULL != h->destroy_task) |
603 | GNUNET_SCHEDULER_cancel (h->destroy_task); | 603 | GNUNET_SCHEDULER_cancel (h->destroy_task); |
604 | h->destroy_task = GNUNET_SCHEDULER_add_now (&do_destroy, | 604 | h->destroy_task = GNUNET_SCHEDULER_add_now (&do_destroy, |
@@ -653,8 +653,8 @@ static int | |||
653 | try_connect (struct GNUNET_STATISTICS_Handle *h) | 653 | try_connect (struct GNUNET_STATISTICS_Handle *h) |
654 | { | 654 | { |
655 | struct GNUNET_MQ_MessageHandler handlers[] = { | 655 | struct GNUNET_MQ_MessageHandler handlers[] = { |
656 | GNUNET_MQ_hd_fixed_size (test, | 656 | GNUNET_MQ_hd_fixed_size (disconnect_confirm, |
657 | GNUNET_MESSAGE_TYPE_TEST, | 657 | GNUNET_MESSAGE_TYPE_STATISTICS_DISCONNECT_CONFIRM, |
658 | struct GNUNET_MessageHeader, | 658 | struct GNUNET_MessageHeader, |
659 | h), | 659 | h), |
660 | GNUNET_MQ_hd_fixed_size (statistics_end, | 660 | GNUNET_MQ_hd_fixed_size (statistics_end, |
@@ -1032,7 +1032,7 @@ schedule_action (void *cls) | |||
1032 | "Notifying service that we are done\n"); | 1032 | "Notifying service that we are done\n"); |
1033 | h->do_destroy = GNUNET_SYSERR; /* in 'TEST' mode */ | 1033 | h->do_destroy = GNUNET_SYSERR; /* in 'TEST' mode */ |
1034 | env = GNUNET_MQ_msg (hdr, | 1034 | env = GNUNET_MQ_msg (hdr, |
1035 | GNUNET_MESSAGE_TYPE_TEST); | 1035 | GNUNET_MESSAGE_TYPE_STATISTICS_DISCONNECT); |
1036 | GNUNET_MQ_notify_sent (env, | 1036 | GNUNET_MQ_notify_sent (env, |
1037 | &schedule_action, | 1037 | &schedule_action, |
1038 | h); | 1038 | h); |