diff options
Diffstat (limited to 'src/testbed/testbed_api_barriers.c')
-rw-r--r-- | src/testbed/testbed_api_barriers.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/testbed/testbed_api_barriers.c b/src/testbed/testbed_api_barriers.c index 2a197719f..2ec34bb1b 100644 --- a/src/testbed/testbed_api_barriers.c +++ b/src/testbed/testbed_api_barriers.c | |||
@@ -21,7 +21,7 @@ | |||
21 | /** | 21 | /** |
22 | * @file testbed/testbed_api_barriers.c | 22 | * @file testbed/testbed_api_barriers.c |
23 | * @brief API implementation for testbed barriers | 23 | * @brief API implementation for testbed barriers |
24 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> | 24 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> |
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include "platform.h" | 27 | #include "platform.h" |
@@ -55,7 +55,7 @@ struct GNUNET_TESTBED_Barrier | |||
55 | * The controller handle given while initiliasing this barrier | 55 | * The controller handle given while initiliasing this barrier |
56 | */ | 56 | */ |
57 | struct GNUNET_TESTBED_Controller *c; | 57 | struct GNUNET_TESTBED_Controller *c; |
58 | 58 | ||
59 | /** | 59 | /** |
60 | * The name of the barrier | 60 | * The name of the barrier |
61 | */ | 61 | */ |
@@ -70,7 +70,7 @@ struct GNUNET_TESTBED_Barrier | |||
70 | * the closure for the above callback | 70 | * the closure for the above callback |
71 | */ | 71 | */ |
72 | void *cls; | 72 | void *cls; |
73 | 73 | ||
74 | /** | 74 | /** |
75 | * Should the barrier crossed status message be echoed back to the controller? | 75 | * Should the barrier crossed status message be echoed back to the controller? |
76 | */ | 76 | */ |
@@ -125,15 +125,15 @@ GNUNET_TESTBED_handle_barrier_status_ (struct GNUNET_TESTBED_Controller *c, | |||
125 | struct GNUNET_TESTBED_Barrier *barrier; | 125 | struct GNUNET_TESTBED_Barrier *barrier; |
126 | char *emsg; | 126 | char *emsg; |
127 | const char *name; | 127 | const char *name; |
128 | struct GNUNET_HashCode key; | 128 | struct GNUNET_HashCode key; |
129 | size_t emsg_len; | 129 | size_t emsg_len; |
130 | int status; | 130 | int status; |
131 | uint16_t msize; | 131 | uint16_t msize; |
132 | uint16_t name_len; | 132 | uint16_t name_len; |
133 | 133 | ||
134 | emsg = NULL; | 134 | emsg = NULL; |
135 | barrier = NULL; | 135 | barrier = NULL; |
136 | msize = ntohs (msg->header.size); | 136 | msize = ntohs (msg->header.size); |
137 | name = msg->data; | 137 | name = msg->data; |
138 | name_len = ntohs (msg->name_len); | 138 | name_len = ntohs (msg->name_len); |
139 | LOG_DEBUG ("Received BARRIER_STATUS msg\n"); | 139 | LOG_DEBUG ("Received BARRIER_STATUS msg\n"); |
@@ -219,7 +219,7 @@ GNUNET_TESTBED_barrier_init_ (struct GNUNET_TESTBED_Controller *controller, | |||
219 | struct GNUNET_HashCode key; | 219 | struct GNUNET_HashCode key; |
220 | size_t name_len; | 220 | size_t name_len; |
221 | uint16_t msize; | 221 | uint16_t msize; |
222 | 222 | ||
223 | GNUNET_assert (quorum <= 100); | 223 | GNUNET_assert (quorum <= 100); |
224 | GNUNET_assert (NULL != cb); | 224 | GNUNET_assert (NULL != cb); |
225 | name_len = strlen (name); | 225 | name_len = strlen (name); |
@@ -310,11 +310,11 @@ struct GNUNET_TESTBED_BarrierWaitHandle | |||
310 | * The name of the barrier | 310 | * The name of the barrier |
311 | */ | 311 | */ |
312 | char *name; | 312 | char *name; |
313 | 313 | ||
314 | /** | 314 | /** |
315 | * Then configuration used for the client connection | 315 | * Then configuration used for the client connection |
316 | */ | 316 | */ |
317 | struct GNUNET_CONFIGURATION_Handle *cfg; | 317 | struct GNUNET_CONFIGURATION_Handle *cfg; |
318 | 318 | ||
319 | /** | 319 | /** |
320 | * The client connection | 320 | * The client connection |
@@ -376,7 +376,7 @@ receive_handler (void *cls, const struct GNUNET_MessageHeader *message) | |||
376 | struct GNUNET_TESTBED_BarrierWaitHandle *h = cls; | 376 | struct GNUNET_TESTBED_BarrierWaitHandle *h = cls; |
377 | const struct GNUNET_TESTBED_BarrierStatusMsg *msg; | 377 | const struct GNUNET_TESTBED_BarrierStatusMsg *msg; |
378 | uint16_t msize; | 378 | uint16_t msize; |
379 | 379 | ||
380 | if (NULL == message) | 380 | if (NULL == message) |
381 | { | 381 | { |
382 | GNUNET_break_op (0); | 382 | GNUNET_break_op (0); |
@@ -386,13 +386,13 @@ receive_handler (void *cls, const struct GNUNET_MessageHeader *message) | |||
386 | { | 386 | { |
387 | GNUNET_break_op (0); | 387 | GNUNET_break_op (0); |
388 | goto fail; | 388 | goto fail; |
389 | } | 389 | } |
390 | msize = ntohs (message->size); | 390 | msize = ntohs (message->size); |
391 | if (msize <= sizeof (struct GNUNET_TESTBED_BarrierStatusMsg)) | 391 | if (msize <= sizeof (struct GNUNET_TESTBED_BarrierStatusMsg)) |
392 | { | 392 | { |
393 | GNUNET_break_op (0); | 393 | GNUNET_break_op (0); |
394 | goto fail; | 394 | goto fail; |
395 | } | 395 | } |
396 | msg = (const struct GNUNET_TESTBED_BarrierStatusMsg *) message; | 396 | msg = (const struct GNUNET_TESTBED_BarrierStatusMsg *) message; |
397 | switch (ntohs (msg->status)) | 397 | switch (ntohs (msg->status)) |
398 | { | 398 | { |
@@ -432,7 +432,7 @@ transmit_notify (void *cls, size_t size, void *buf) | |||
432 | { | 432 | { |
433 | struct GNUNET_TESTBED_BarrierWaitHandle *h = cls; | 433 | struct GNUNET_TESTBED_BarrierWaitHandle *h = cls; |
434 | uint16_t msize; | 434 | uint16_t msize; |
435 | 435 | ||
436 | h->tx = NULL; | 436 | h->tx = NULL; |
437 | if ((0 == size) || (NULL == buf)) | 437 | if ((0 == size) || (NULL == buf)) |
438 | { | 438 | { |
@@ -507,7 +507,7 @@ GNUNET_TESTBED_barrier_wait (const char *name, | |||
507 | msg->header.size = htons (msize); | 507 | msg->header.size = htons (msize); |
508 | (void) memcpy (msg->name, name, name_len); | 508 | (void) memcpy (msg->name, name, name_len); |
509 | h->msg = &msg->header; | 509 | h->msg = &msg->header; |
510 | h->tx = | 510 | h->tx = |
511 | GNUNET_CLIENT_notify_transmit_ready (h->conn, msize, | 511 | GNUNET_CLIENT_notify_transmit_ready (h->conn, msize, |
512 | GNUNET_TIME_UNIT_FOREVER_REL, | 512 | GNUNET_TIME_UNIT_FOREVER_REL, |
513 | GNUNET_NO, | 513 | GNUNET_NO, |