diff options
Diffstat (limited to 'src/consensus')
-rw-r--r-- | src/consensus/consensus_api.c | 10 | ||||
-rw-r--r-- | src/consensus/gnunet-consensus-profiler.c | 2 | ||||
-rw-r--r-- | src/consensus/gnunet-service-consensus.c | 22 | ||||
-rw-r--r-- | src/consensus/test_consensus_api.c | 2 |
4 files changed, 18 insertions, 18 deletions
diff --git a/src/consensus/consensus_api.c b/src/consensus/consensus_api.c index b2b3694d6..d8e65c52f 100644 --- a/src/consensus/consensus_api.c +++ b/src/consensus/consensus_api.c | |||
@@ -20,7 +20,7 @@ | |||
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @file consensus/consensus_api.c | 22 | * @file consensus/consensus_api.c |
23 | * @brief | 23 | * @brief |
24 | * @author Florian Dold | 24 | * @author Florian Dold |
25 | */ | 25 | */ |
26 | #include "platform.h" | 26 | #include "platform.h" |
@@ -103,7 +103,7 @@ struct InsertDoneInfo | |||
103 | 103 | ||
104 | /** | 104 | /** |
105 | * Called when the server has sent is a new element | 105 | * Called when the server has sent is a new element |
106 | * | 106 | * |
107 | * @param cls consensus handle | 107 | * @param cls consensus handle |
108 | * @param mh element message | 108 | * @param mh element message |
109 | */ | 109 | */ |
@@ -129,7 +129,7 @@ handle_new_element (void *cls, | |||
129 | /** | 129 | /** |
130 | * Called when the server has announced | 130 | * Called when the server has announced |
131 | * that the conclusion is over. | 131 | * that the conclusion is over. |
132 | * | 132 | * |
133 | * @param cls consensus handle | 133 | * @param cls consensus handle |
134 | * @param msg conclude done message | 134 | * @param msg conclude done message |
135 | */ | 135 | */ |
@@ -220,7 +220,7 @@ idc_adapter (void *cls) | |||
220 | * | 220 | * |
221 | * @param consensus handle for the consensus session | 221 | * @param consensus handle for the consensus session |
222 | * @param element the element to be inserted | 222 | * @param element the element to be inserted |
223 | * @param idc function called when we are done with this element and it | 223 | * @param idc function called when we are done with this element and it |
224 | * is thus allowed to call GNUNET_CONSENSUS_insert again | 224 | * is thus allowed to call GNUNET_CONSENSUS_insert again |
225 | * @param idc_cls closure for 'idc' | 225 | * @param idc_cls closure for 'idc' |
226 | */ | 226 | */ |
@@ -240,7 +240,7 @@ GNUNET_CONSENSUS_insert (struct GNUNET_CONSENSUS_Handle *consensus, | |||
240 | GNUNET_MESSAGE_TYPE_CONSENSUS_CLIENT_INSERT); | 240 | GNUNET_MESSAGE_TYPE_CONSENSUS_CLIENT_INSERT); |
241 | 241 | ||
242 | memcpy (&element_msg[1], element->data, element->size); | 242 | memcpy (&element_msg[1], element->data, element->size); |
243 | 243 | ||
244 | if (NULL != idc) | 244 | if (NULL != idc) |
245 | { | 245 | { |
246 | i = GNUNET_new (struct InsertDoneInfo); | 246 | i = GNUNET_new (struct InsertDoneInfo); |
diff --git a/src/consensus/gnunet-consensus-profiler.c b/src/consensus/gnunet-consensus-profiler.c index 00e017246..bade332b5 100644 --- a/src/consensus/gnunet-consensus-profiler.c +++ b/src/consensus/gnunet-consensus-profiler.c | |||
@@ -206,7 +206,7 @@ new_element_cb (void *cls, | |||
206 | int idx = chp - consensus_handles; | 206 | int idx = chp - consensus_handles; |
207 | 207 | ||
208 | GNUNET_assert (NULL != cls); | 208 | GNUNET_assert (NULL != cls); |
209 | 209 | ||
210 | results_for_peer[idx]++; | 210 | results_for_peer[idx]++; |
211 | 211 | ||
212 | GNUNET_assert (sizeof (struct GNUNET_HashCode) == element->size); | 212 | GNUNET_assert (sizeof (struct GNUNET_HashCode) == element->size); |
diff --git a/src/consensus/gnunet-service-consensus.c b/src/consensus/gnunet-service-consensus.c index 74f758034..914943f11 100644 --- a/src/consensus/gnunet-service-consensus.c +++ b/src/consensus/gnunet-service-consensus.c | |||
@@ -147,7 +147,7 @@ struct ConsensusSession | |||
147 | * Only valid once the current round is not CONSENSUS_ROUND_BEGIN. | 147 | * Only valid once the current round is not CONSENSUS_ROUND_BEGIN. |
148 | */ | 148 | */ |
149 | struct GNUNET_TIME_Relative conclude_timeout; | 149 | struct GNUNET_TIME_Relative conclude_timeout; |
150 | 150 | ||
151 | /** | 151 | /** |
152 | * Timeout task identifier for the current round. | 152 | * Timeout task identifier for the current round. |
153 | */ | 153 | */ |
@@ -286,7 +286,7 @@ have_exp_subround_finished (const struct ConsensusSession *session) | |||
286 | { | 286 | { |
287 | int not_finished; | 287 | int not_finished; |
288 | not_finished = 0; | 288 | not_finished = 0; |
289 | if ( (NULL != session->partner_outgoing) && | 289 | if ( (NULL != session->partner_outgoing) && |
290 | (GNUNET_NO == session->partner_outgoing->exp_subround_finished) ) | 290 | (GNUNET_NO == session->partner_outgoing->exp_subround_finished) ) |
291 | not_finished++; | 291 | not_finished++; |
292 | if ( (NULL != session->partner_incoming) && | 292 | if ( (NULL != session->partner_incoming) && |
@@ -300,7 +300,7 @@ have_exp_subround_finished (const struct ConsensusSession *session) | |||
300 | 300 | ||
301 | /** | 301 | /** |
302 | * Destroy a session, free all resources associated with it. | 302 | * Destroy a session, free all resources associated with it. |
303 | * | 303 | * |
304 | * @param session the session to destroy | 304 | * @param session the session to destroy |
305 | */ | 305 | */ |
306 | static void | 306 | static void |
@@ -404,7 +404,7 @@ send_to_client_iter (void *cls, | |||
404 | * @param tc task context, for when this task is invoked by the scheduler, | 404 | * @param tc task context, for when this task is invoked by the scheduler, |
405 | * NULL if invoked for another reason | 405 | * NULL if invoked for another reason |
406 | */ | 406 | */ |
407 | static void | 407 | static void |
408 | round_over (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 408 | round_over (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
409 | { | 409 | { |
410 | struct ConsensusSession *session; | 410 | struct ConsensusSession *session; |
@@ -459,7 +459,7 @@ shuffle (struct ConsensusSession *session) | |||
459 | if (NULL == session->shuffle_inv) | 459 | if (NULL == session->shuffle_inv) |
460 | session->shuffle_inv = GNUNET_malloc (session->num_peers * sizeof (*session->shuffle_inv)); | 460 | session->shuffle_inv = GNUNET_malloc (session->num_peers * sizeof (*session->shuffle_inv)); |
461 | 461 | ||
462 | GNUNET_CRYPTO_kdf (randomness, sizeof (randomness), | 462 | GNUNET_CRYPTO_kdf (randomness, sizeof (randomness), |
463 | &session->exp_round, sizeof (uint32_t), | 463 | &session->exp_round, sizeof (uint32_t), |
464 | &session->global_id, sizeof (struct GNUNET_HashCode), | 464 | &session->global_id, sizeof (struct GNUNET_HashCode), |
465 | NULL); | 465 | NULL); |
@@ -559,7 +559,7 @@ find_partners (struct ConsensusSession *session) | |||
559 | * @param element a result element, only valid if status is GNUNET_SET_STATUS_OK | 559 | * @param element a result element, only valid if status is GNUNET_SET_STATUS_OK |
560 | * @param status see enum GNUNET_SET_Status | 560 | * @param status see enum GNUNET_SET_Status |
561 | */ | 561 | */ |
562 | static void | 562 | static void |
563 | set_result_cb (void *cls, | 563 | set_result_cb (void *cls, |
564 | const struct GNUNET_SET_Element *element, | 564 | const struct GNUNET_SET_Element *element, |
565 | enum GNUNET_SET_Status status) | 565 | enum GNUNET_SET_Status status) |
@@ -674,7 +674,7 @@ subround_over (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
674 | GNUNET_SCHEDULER_cancel (session->round_timeout_tid); | 674 | GNUNET_SCHEDULER_cancel (session->round_timeout_tid); |
675 | session->round_timeout_tid = GNUNET_SCHEDULER_NO_TASK; | 675 | session->round_timeout_tid = GNUNET_SCHEDULER_NO_TASK; |
676 | } | 676 | } |
677 | 677 | ||
678 | if (session->exp_round >= NUM_EXP_ROUNDS) | 678 | if (session->exp_round >= NUM_EXP_ROUNDS) |
679 | { | 679 | { |
680 | round_over (session, NULL); | 680 | round_over (session, NULL); |
@@ -700,7 +700,7 @@ subround_over (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
700 | session->exp_subround = 0; | 700 | session->exp_subround = 0; |
701 | shuffle (session); | 701 | shuffle (session); |
702 | } | 702 | } |
703 | else | 703 | else |
704 | { | 704 | { |
705 | session->exp_subround++; | 705 | session->exp_subround++; |
706 | } | 706 | } |
@@ -810,7 +810,7 @@ get_peer_idx (const struct GNUNET_PeerIdentity *peer, const struct ConsensusSess | |||
810 | * @param session_id local id of the consensus session | 810 | * @param session_id local id of the consensus session |
811 | */ | 811 | */ |
812 | static void | 812 | static void |
813 | compute_global_id (struct ConsensusSession *session, | 813 | compute_global_id (struct ConsensusSession *session, |
814 | const struct GNUNET_HashCode *session_id) | 814 | const struct GNUNET_HashCode *session_id) |
815 | { | 815 | { |
816 | int i; | 816 | int i; |
@@ -865,7 +865,7 @@ initialize_session_peer_list (struct ConsensusSession *session, | |||
865 | 865 | ||
866 | /* peers in the join message, may or may not include the local peer */ | 866 | /* peers in the join message, may or may not include the local peer */ |
867 | listed_peers = ntohl (join_msg->num_peers); | 867 | listed_peers = ntohl (join_msg->num_peers); |
868 | 868 | ||
869 | session->num_peers = listed_peers; | 869 | session->num_peers = listed_peers; |
870 | 870 | ||
871 | msg_peers = (struct GNUNET_PeerIdentity *) &join_msg[1]; | 871 | msg_peers = (struct GNUNET_PeerIdentity *) &join_msg[1]; |
@@ -1025,7 +1025,7 @@ initialize_session (struct ConsensusSession *session, | |||
1025 | other_session = sessions_head; | 1025 | other_session = sessions_head; |
1026 | while (NULL != other_session) | 1026 | while (NULL != other_session) |
1027 | { | 1027 | { |
1028 | if ((other_session != session) && | 1028 | if ((other_session != session) && |
1029 | (0 == GNUNET_CRYPTO_hash_cmp (&session->global_id, &other_session->global_id))) | 1029 | (0 == GNUNET_CRYPTO_hash_cmp (&session->global_id, &other_session->global_id))) |
1030 | { | 1030 | { |
1031 | if (CONSENSUS_ROUND_FINISH != other_session->current_round) | 1031 | if (CONSENSUS_ROUND_FINISH != other_session->current_round) |
diff --git a/src/consensus/test_consensus_api.c b/src/consensus/test_consensus_api.c index 37a5eb692..9b6f71f7a 100644 --- a/src/consensus/test_consensus_api.c +++ b/src/consensus/test_consensus_api.c | |||
@@ -82,7 +82,7 @@ on_shutdown (void *cls, | |||
82 | 82 | ||
83 | 83 | ||
84 | static void | 84 | static void |
85 | run (void *cls, | 85 | run (void *cls, |
86 | const struct GNUNET_CONFIGURATION_Handle *cfg, | 86 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
87 | struct GNUNET_TESTING_Peer *peer) | 87 | struct GNUNET_TESTING_Peer *peer) |
88 | { | 88 | { |