aboutsummaryrefslogtreecommitdiff
path: root/src/testbed
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2013-09-09 14:52:57 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2013-09-09 14:52:57 +0000
commit7f39e259f05fa949b2ad45983195360b06f2d51b (patch)
tree8ae5fea78906d02292b2cff439bd1f7b3d73cb30 /src/testbed
parentf0d5fd42884fddd1d625e37a23fb8900738a8d33 (diff)
downloadgnunet-7f39e259f05fa949b2ad45983195360b06f2d51b.tar.gz
gnunet-7f39e259f05fa949b2ad45983195360b06f2d51b.zip
- fix compile
Diffstat (limited to 'src/testbed')
-rw-r--r--src/testbed/gnunet-service-testbed_barriers.c12
-rw-r--r--src/testbed/test_testbed_api_barriers.h5
2 files changed, 12 insertions, 5 deletions
diff --git a/src/testbed/gnunet-service-testbed_barriers.c b/src/testbed/gnunet-service-testbed_barriers.c
index 693396ef6..663c090b6 100644
--- a/src/testbed/gnunet-service-testbed_barriers.c
+++ b/src/testbed/gnunet-service-testbed_barriers.c
@@ -168,7 +168,7 @@ struct Barrier
168 /** 168 /**
169 * The client handle to the master controller 169 * The client handle to the master controller
170 */ 170 */
171 struct GNUNET_SERVER_Client *client; 171 struct GNUNET_SERVER_Client *mc;
172 172
173 /** 173 /**
174 * The name of the barrier 174 * The name of the barrier
@@ -308,6 +308,8 @@ queue_message (struct ClientCtx *ctx, struct GNUNET_MessageHeader *msg)
308 308
309 mq = GNUNET_malloc (sizeof (struct MessageQueue)); 309 mq = GNUNET_malloc (sizeof (struct MessageQueue));
310 mq->msg = msg; 310 mq->msg = msg;
311 LOG_DEBUG ("Queueing message of type %u, size %u for sending\n",
312 ntohs (msg->type), ntohs (msg->size));
311 GNUNET_CONTAINER_DLL_insert_tail (ctx->mq_head, ctx->mq_tail, mq); 313 GNUNET_CONTAINER_DLL_insert_tail (ctx->mq_head, ctx->mq_tail, mq);
312 if (NULL == ctx->tx) 314 if (NULL == ctx->tx)
313 ctx->tx = GNUNET_SERVER_notify_transmit_ready (client, ntohs (msg->size), 315 ctx->tx = GNUNET_SERVER_notify_transmit_ready (client, ntohs (msg->size),
@@ -359,7 +361,7 @@ remove_barrier (struct Barrier *barrier)
359 cleanup_clientctx (ctx); 361 cleanup_clientctx (ctx);
360 } 362 }
361 GNUNET_free (barrier->name); 363 GNUNET_free (barrier->name);
362 GNUNET_SERVER_client_drop (barrier->client); 364 GNUNET_SERVER_client_drop (barrier->mc);
363 GNUNET_free (barrier); 365 GNUNET_free (barrier);
364} 366}
365 367
@@ -430,8 +432,7 @@ static void
430send_barrier_status_msg (struct Barrier *barrier, const char *emsg) 432send_barrier_status_msg (struct Barrier *barrier, const char *emsg)
431{ 433{
432 GNUNET_assert (0 != barrier->status); 434 GNUNET_assert (0 != barrier->status);
433 send_client_status_msg (barrier->client, barrier->name, 435 send_client_status_msg (barrier->mc, barrier->name, barrier->status, emsg);
434 barrier->status, emsg);
435} 436}
436 437
437 438
@@ -529,6 +530,7 @@ handle_barrier_wait (void *cls, struct GNUNET_SERVER_Client *client,
529 GNUNET_SERVER_client_keep (client); 530 GNUNET_SERVER_client_keep (client);
530 client_ctx->barrier = barrier; 531 client_ctx->barrier = barrier;
531 GNUNET_CONTAINER_DLL_insert_tail (barrier->head, barrier->tail, client_ctx); 532 GNUNET_CONTAINER_DLL_insert_tail (barrier->head, barrier->tail, client_ctx);
533 GNUNET_SERVER_client_set_user_context (client, client_ctx);
532 } 534 }
533 barrier->nreached++; 535 barrier->nreached++;
534 if ((barrier->num_wbarriers_reached == barrier->num_wbarriers) 536 if ((barrier->num_wbarriers_reached == barrier->num_wbarriers)
@@ -754,7 +756,7 @@ GST_handle_barrier_init (void *cls, struct GNUNET_SERVER_Client *client,
754 (void) memcpy (&barrier->hash, &hash, sizeof (struct GNUNET_HashCode)); 756 (void) memcpy (&barrier->hash, &hash, sizeof (struct GNUNET_HashCode));
755 barrier->quorum = msg->quorum; 757 barrier->quorum = msg->quorum;
756 barrier->name = name; 758 barrier->name = name;
757 barrier->client = client; 759 barrier->mc = client;
758 GNUNET_SERVER_client_keep (client); 760 GNUNET_SERVER_client_keep (client);
759 GNUNET_assert (GNUNET_OK == 761 GNUNET_assert (GNUNET_OK ==
760 GNUNET_CONTAINER_multihashmap_put (barrier_map, 762 GNUNET_CONTAINER_multihashmap_put (barrier_map,
diff --git a/src/testbed/test_testbed_api_barriers.h b/src/testbed/test_testbed_api_barriers.h
new file mode 100644
index 000000000..dbcdbd80f
--- /dev/null
+++ b/src/testbed/test_testbed_api_barriers.h
@@ -0,0 +1,5 @@
1
2/**
3 * The name to use for the barrier in the test cases
4 */
5#define TEST_BARRIER_NAME "test_barrier"