diff options
Diffstat (limited to 'src/testbed/gnunet-service-testbed_barriers.c')
-rw-r--r-- | src/testbed/gnunet-service-testbed_barriers.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/testbed/gnunet-service-testbed_barriers.c b/src/testbed/gnunet-service-testbed_barriers.c index 5668d03cf..c1d5036eb 100644 --- a/src/testbed/gnunet-service-testbed_barriers.c +++ b/src/testbed/gnunet-service-testbed_barriers.c | |||
@@ -394,7 +394,7 @@ cancel_wrappers (struct Barrier *barrier) | |||
394 | * @param name the barrier name | 394 | * @param name the barrier name |
395 | * @param status the status of the barrier | 395 | * @param status the status of the barrier |
396 | * @param emsg the error message; should be non-NULL for | 396 | * @param emsg the error message; should be non-NULL for |
397 | * status=BARRIER_STATUS_ERROR | 397 | * status=GNUNET_TESTBED_BARRIERSTATUS_ERROR |
398 | */ | 398 | */ |
399 | static void | 399 | static void |
400 | send_client_status_msg (struct GNUNET_SERVER_Client *client, | 400 | send_client_status_msg (struct GNUNET_SERVER_Client *client, |
@@ -406,7 +406,7 @@ send_client_status_msg (struct GNUNET_SERVER_Client *client, | |||
406 | size_t name_len; | 406 | size_t name_len; |
407 | uint16_t msize; | 407 | uint16_t msize; |
408 | 408 | ||
409 | GNUNET_assert ((NULL == emsg) || (BARRIER_STATUS_ERROR == status)); | 409 | GNUNET_assert ((NULL == emsg) || (GNUNET_TESTBED_BARRIERSTATUS_ERROR == status)); |
410 | name_len = strlen (name); | 410 | name_len = strlen (name); |
411 | msize = sizeof (struct GNUNET_TESTBED_BarrierStatusMsg) | 411 | msize = sizeof (struct GNUNET_TESTBED_BarrierStatusMsg) |
412 | + (name_len + 1) | 412 | + (name_len + 1) |
@@ -428,7 +428,7 @@ send_client_status_msg (struct GNUNET_SERVER_Client *client, | |||
428 | * | 428 | * |
429 | * @param barrier the corresponding barrier | 429 | * @param barrier the corresponding barrier |
430 | * @param emsg the error message; should be non-NULL for | 430 | * @param emsg the error message; should be non-NULL for |
431 | * status=BARRIER_STATUS_ERROR | 431 | * status=GNUNET_TESTBED_BARRIERSTATUS_ERROR |
432 | */ | 432 | */ |
433 | static void | 433 | static void |
434 | send_barrier_status_msg (struct Barrier *barrier, const char *emsg) | 434 | send_barrier_status_msg (struct Barrier *barrier, const char *emsg) |
@@ -503,7 +503,7 @@ handle_barrier_wait (void *cls, struct GNUNET_SERVER_Client *client, | |||
503 | if ((barrier->num_wbarriers_reached == barrier->num_wbarriers) | 503 | if ((barrier->num_wbarriers_reached == barrier->num_wbarriers) |
504 | && (LOCAL_QUORUM_REACHED (barrier))) | 504 | && (LOCAL_QUORUM_REACHED (barrier))) |
505 | { | 505 | { |
506 | barrier->status = BARRIER_STATUS_CROSSED; | 506 | barrier->status = GNUNET_TESTBED_BARRIERSTATUS_CROSSED; |
507 | send_barrier_status_msg (barrier, NULL); | 507 | send_barrier_status_msg (barrier, NULL); |
508 | } | 508 | } |
509 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 509 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
@@ -596,18 +596,18 @@ wbarrier_status_cb (void *cls, const char *name, | |||
596 | GNUNET_free (wrapper); | 596 | GNUNET_free (wrapper); |
597 | switch (status) | 597 | switch (status) |
598 | { | 598 | { |
599 | case BARRIER_STATUS_ERROR: | 599 | case GNUNET_TESTBED_BARRIERSTATUS_ERROR: |
600 | LOG (GNUNET_ERROR_TYPE_ERROR, | 600 | LOG (GNUNET_ERROR_TYPE_ERROR, |
601 | "Initialising barrier `%s' failed at a sub-controller: %s\n", | 601 | "Initialising barrier `%s' failed at a sub-controller: %s\n", |
602 | barrier->name, (NULL != emsg) ? emsg : "NULL"); | 602 | barrier->name, (NULL != emsg) ? emsg : "NULL"); |
603 | cancel_wrappers (barrier); | 603 | cancel_wrappers (barrier); |
604 | if (NULL == emsg) | 604 | if (NULL == emsg) |
605 | emsg = "Initialisation failed at a sub-controller"; | 605 | emsg = "Initialisation failed at a sub-controller"; |
606 | barrier->status = BARRIER_STATUS_ERROR; | 606 | barrier->status = GNUNET_TESTBED_BARRIERSTATUS_ERROR; |
607 | send_barrier_status_msg (barrier, emsg); | 607 | send_barrier_status_msg (barrier, emsg); |
608 | return; | 608 | return; |
609 | case BARRIER_STATUS_CROSSED: | 609 | case GNUNET_TESTBED_BARRIERSTATUS_CROSSED: |
610 | if (BARRIER_STATUS_INITIALISED != barrier->status) | 610 | if (GNUNET_TESTBED_BARRIERSTATUS_INITIALISED != barrier->status) |
611 | { | 611 | { |
612 | GNUNET_break_op (0); | 612 | GNUNET_break_op (0); |
613 | return; | 613 | return; |
@@ -616,11 +616,11 @@ wbarrier_status_cb (void *cls, const char *name, | |||
616 | if ((barrier->num_wbarriers_reached == barrier->num_wbarriers) | 616 | if ((barrier->num_wbarriers_reached == barrier->num_wbarriers) |
617 | && (LOCAL_QUORUM_REACHED (barrier))) | 617 | && (LOCAL_QUORUM_REACHED (barrier))) |
618 | { | 618 | { |
619 | barrier->status = BARRIER_STATUS_CROSSED; | 619 | barrier->status = GNUNET_TESTBED_BARRIERSTATUS_CROSSED; |
620 | send_barrier_status_msg (barrier, NULL); | 620 | send_barrier_status_msg (barrier, NULL); |
621 | } | 621 | } |
622 | return; | 622 | return; |
623 | case BARRIER_STATUS_INITIALISED: | 623 | case GNUNET_TESTBED_BARRIERSTATUS_INITIALISED: |
624 | if (0 != barrier->status) | 624 | if (0 != barrier->status) |
625 | { | 625 | { |
626 | GNUNET_break_op (0); | 626 | GNUNET_break_op (0); |
@@ -629,7 +629,7 @@ wbarrier_status_cb (void *cls, const char *name, | |||
629 | barrier->num_wbarriers_inited++; | 629 | barrier->num_wbarriers_inited++; |
630 | if (barrier->num_wbarriers_inited == barrier->num_wbarriers) | 630 | if (barrier->num_wbarriers_inited == barrier->num_wbarriers) |
631 | { | 631 | { |
632 | barrier->status = BARRIER_STATUS_INITIALISED; | 632 | barrier->status = GNUNET_TESTBED_BARRIERSTATUS_INITIALISED; |
633 | send_barrier_status_msg (barrier, NULL); | 633 | send_barrier_status_msg (barrier, NULL); |
634 | } | 634 | } |
635 | return; | 635 | return; |
@@ -650,7 +650,7 @@ fwd_tout_barrier_init (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
650 | struct Barrier *barrier = cls; | 650 | struct Barrier *barrier = cls; |
651 | 651 | ||
652 | cancel_wrappers (barrier); | 652 | cancel_wrappers (barrier); |
653 | barrier->status = BARRIER_STATUS_ERROR; | 653 | barrier->status = GNUNET_TESTBED_BARRIERSTATUS_ERROR; |
654 | send_barrier_status_msg (barrier, | 654 | send_barrier_status_msg (barrier, |
655 | "Timedout while propagating barrier initialisation\n"); | 655 | "Timedout while propagating barrier initialisation\n"); |
656 | remove_barrier (barrier); | 656 | remove_barrier (barrier); |
@@ -711,7 +711,7 @@ GST_handle_barrier_init (void *cls, struct GNUNET_SERVER_Client *client, | |||
711 | if (GNUNET_YES == GNUNET_CONTAINER_multihashmap_contains (barrier_map, &hash)) | 711 | if (GNUNET_YES == GNUNET_CONTAINER_multihashmap_contains (barrier_map, &hash)) |
712 | { | 712 | { |
713 | 713 | ||
714 | send_client_status_msg (client, name, BARRIER_STATUS_ERROR, | 714 | send_client_status_msg (client, name, GNUNET_TESTBED_BARRIERSTATUS_ERROR, |
715 | "A barrier with the same name already exists"); | 715 | "A barrier with the same name already exists"); |
716 | GNUNET_free (name); | 716 | GNUNET_free (name); |
717 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 717 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
@@ -751,8 +751,8 @@ GST_handle_barrier_init (void *cls, struct GNUNET_SERVER_Client *client, | |||
751 | } | 751 | } |
752 | if (NULL == barrier->whead) /* No further propagation */ | 752 | if (NULL == barrier->whead) /* No further propagation */ |
753 | { | 753 | { |
754 | barrier->status = BARRIER_STATUS_INITIALISED; | 754 | barrier->status = GNUNET_TESTBED_BARRIERSTATUS_INITIALISED; |
755 | LOG_DEBUG ("Sending BARRIER_STATUS_INITIALISED for barrier `%s'\n", | 755 | LOG_DEBUG ("Sending GNUNET_TESTBED_BARRIERSTATUS_INITIALISED for barrier `%s'\n", |
756 | barrier->name); | 756 | barrier->name); |
757 | send_barrier_status_msg (barrier, NULL); | 757 | send_barrier_status_msg (barrier, NULL); |
758 | }else | 758 | }else |
@@ -866,7 +866,7 @@ GST_handle_barrier_status (void *cls, struct GNUNET_SERVER_Client *client, | |||
866 | } | 866 | } |
867 | msg = (const struct GNUNET_TESTBED_BarrierStatusMsg *) message; | 867 | msg = (const struct GNUNET_TESTBED_BarrierStatusMsg *) message; |
868 | status = ntohs (msg->status); | 868 | status = ntohs (msg->status); |
869 | if (BARRIER_STATUS_CROSSED != status) | 869 | if (GNUNET_TESTBED_BARRIERSTATUS_CROSSED != status) |
870 | { | 870 | { |
871 | GNUNET_break_op (0); /* current we only expect BARRIER_CROSSED | 871 | GNUNET_break_op (0); /* current we only expect BARRIER_CROSSED |
872 | status message this way */ | 872 | status message this way */ |