[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r20017 - gnunet/src/dht
From: |
gnunet |
Subject: |
[GNUnet-SVN] r20017 - gnunet/src/dht |
Date: |
Fri, 24 Feb 2012 17:48:35 +0100 |
Author: bartpolot
Date: 2012-02-24 17:48:35 +0100 (Fri, 24 Feb 2012)
New Revision: 20017
Modified:
gnunet/src/dht/test_dht_multipeer.c
gnunet/src/dht/test_dht_twopeer_path_tracking.c
Log:
- Avoid calling daemons_stop with NULL, minor doxygen fixes
Modified: gnunet/src/dht/test_dht_multipeer.c
===================================================================
--- gnunet/src/dht/test_dht_multipeer.c 2012-02-24 16:37:32 UTC (rev 20016)
+++ gnunet/src/dht/test_dht_multipeer.c 2012-02-24 16:48:35 UTC (rev 20017)
@@ -207,6 +207,11 @@
static GNUNET_SCHEDULER_TaskIdentifier die_task;
/**
+ * Task handle to use to schedule test shutdown
+ */
+GNUNET_SCHEDULER_TaskIdentifier shutdown_task;
+
+/**
* Global return value (0 for success, anything else for failure)
*/
static int ok;
@@ -224,14 +229,27 @@
if (ok == 0)
ok = 2;
}
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Shutdown callback completed.\n");
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutdown callback completed.\n");
}
static void
do_stop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Shutdown requested.\n");
- GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
+ if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) == 0)
+ {
+ if (GNUNET_SCHEDULER_NO_TASK != shutdown_task)
+ {
+ GNUNET_SCHEDULER_cancel(shutdown_task);
+ shutdown_task = GNUNET_SCHEDULER_NO_TASK;
+ }
+ }
+ else
+ {
+ shutdown_task = GNUNET_SCHEDULER_NO_TASK ;
+ }
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutdown requested.\n");
+ if (NULL != pg)
+ GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
pg = NULL;
}
@@ -790,8 +808,8 @@
pg = GNUNET_TESTING_peergroup_start (cfg, num_peers, TIMEOUT, NULL,
&startup_done, NULL, NULL);
GNUNET_assert (NULL != pg);
- GNUNET_SCHEDULER_add_delayed(GNUNET_TIME_UNIT_FOREVER_REL,
- &do_stop, NULL);
+ shutdown_task = GNUNET_SCHEDULER_add_delayed(GNUNET_TIME_UNIT_FOREVER_REL,
+ &do_stop, NULL);
}
Modified: gnunet/src/dht/test_dht_twopeer_path_tracking.c
===================================================================
--- gnunet/src/dht/test_dht_twopeer_path_tracking.c 2012-02-24 16:37:32 UTC
(rev 20016)
+++ gnunet/src/dht/test_dht_twopeer_path_tracking.c 2012-02-24 16:48:35 UTC
(rev 20017)
@@ -86,10 +86,14 @@
*/
static unsigned int failed_connections;
-/* Task handle to use to schedule test failure */
+/**
+ * Task handle to use to schedule test failure
+ */
GNUNET_SCHEDULER_TaskIdentifier die_task;
-/* Global return value (0 for success, anything else for failure) */
+/**
+ * Global return value (0 for success, anything else for failure)
+ */
static int ok;
/**
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r20017 - gnunet/src/dht,
gnunet <=