aboutsummaryrefslogtreecommitdiff
path: root/src/testbed/gnunet-service-testbed_peers.c
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2013-11-28 15:12:50 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2013-11-28 15:12:50 +0000
commit7fe7d7d8824379a8db473d4651fc28ba5fa8c698 (patch)
treefda53ca6a4568f02c1e9e7a55e53fb31ebfa182b /src/testbed/gnunet-service-testbed_peers.c
parent777d9cd68b19282fdc5b5e22ba93710dc3424ffd (diff)
downloadgnunet-7fe7d7d8824379a8db473d4651fc28ba5fa8c698.tar.gz
gnunet-7fe7d7d8824379a8db473d4651fc28ba5fa8c698.zip
- don't timeout SHUTDOWN_PEERS operation
Diffstat (limited to 'src/testbed/gnunet-service-testbed_peers.c')
-rw-r--r--src/testbed/gnunet-service-testbed_peers.c38
1 files changed, 0 insertions, 38 deletions
diff --git a/src/testbed/gnunet-service-testbed_peers.c b/src/testbed/gnunet-service-testbed_peers.c
index 74aff7d47..d653ab3ba 100644
--- a/src/testbed/gnunet-service-testbed_peers.c
+++ b/src/testbed/gnunet-service-testbed_peers.c
@@ -1308,38 +1308,6 @@ GST_destroy_peers ()
1308 1308
1309 1309
1310/** 1310/**
1311 * Task run upon timeout of forwarded SHUTDOWN_PEERS operation
1312 *
1313 * @param cls the ForwardedOperationContext
1314 * @param tc the scheduler task context
1315 */
1316static void
1317shutdown_peers_timeout_cb (void *cls,
1318 const struct GNUNET_SCHEDULER_TaskContext *tc)
1319{
1320 struct ForwardedOperationContext *fo_ctxt = cls;
1321 struct HandlerContext_ShutdownPeers *hc;
1322
1323 fo_ctxt->timeout_task = GNUNET_SCHEDULER_NO_TASK;
1324 hc = fo_ctxt->cls;
1325 hc->timeout = GNUNET_YES;
1326 GNUNET_assert (0 < hc->nslaves);
1327 hc->nslaves--;
1328 if (0 == hc->nslaves)
1329 {
1330 GST_send_operation_fail_msg (fo_ctxt->client, fo_ctxt->operation_id,
1331 "Timeout at a slave controller");
1332 GNUNET_free (hc);
1333 hc = NULL;
1334 }
1335 GNUNET_TESTBED_forward_operation_msg_cancel_ (fo_ctxt->opc);
1336 GNUNET_SERVER_client_drop (fo_ctxt->client);
1337 GNUNET_CONTAINER_DLL_remove (fopcq_head, fopcq_tail, fo_ctxt);
1338 GNUNET_free (fo_ctxt);
1339}
1340
1341
1342/**
1343 * The reply msg handler forwarded SHUTDOWN_PEERS operation. Checks if a 1311 * The reply msg handler forwarded SHUTDOWN_PEERS operation. Checks if a
1344 * success reply is received from all clients and then sends the success message 1312 * success reply is received from all clients and then sends the success message
1345 * to the client 1313 * to the client
@@ -1355,9 +1323,6 @@ shutdown_peers_reply_cb (void *cls,
1355 struct HandlerContext_ShutdownPeers *hc; 1323 struct HandlerContext_ShutdownPeers *hc;
1356 1324
1357 hc = fo_ctxt->cls; 1325 hc = fo_ctxt->cls;
1358 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != fo_ctxt->timeout_task);
1359 GNUNET_SCHEDULER_cancel (fo_ctxt->timeout_task);
1360 fo_ctxt->timeout_task = GNUNET_SCHEDULER_NO_TASK;
1361 GNUNET_assert (0 < hc->nslaves); 1326 GNUNET_assert (0 < hc->nslaves);
1362 hc->nslaves--; 1327 hc->nslaves--;
1363 if (GNUNET_MESSAGE_TYPE_TESTBED_GENERIC_OPERATION_SUCCESS != 1328 if (GNUNET_MESSAGE_TYPE_TESTBED_GENERIC_OPERATION_SUCCESS !=
@@ -1430,9 +1395,6 @@ GST_handle_shutdown_peers (void *cls, struct GNUNET_SERVER_Client *client,
1430 &msg->header, 1395 &msg->header,
1431 shutdown_peers_reply_cb, 1396 shutdown_peers_reply_cb,
1432 fo_ctxt); 1397 fo_ctxt);
1433 fo_ctxt->timeout_task =
1434 GNUNET_SCHEDULER_add_delayed (GST_timeout, &shutdown_peers_timeout_cb,
1435 fo_ctxt);
1436 GNUNET_CONTAINER_DLL_insert_tail (fopcq_head, fopcq_tail, fo_ctxt); 1398 GNUNET_CONTAINER_DLL_insert_tail (fopcq_head, fopcq_tail, fo_ctxt);
1437 } 1399 }
1438 LOG_DEBUG ("Shutting down peers\n"); 1400 LOG_DEBUG ("Shutting down peers\n");