gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r12016 - gnunet/src/topology


From: gnunet
Subject: [GNUnet-SVN] r12016 - gnunet/src/topology
Date: Mon, 28 Jun 2010 14:23:08 +0200

Author: nevans
Date: 2010-06-28 14:23:08 +0200 (Mon, 28 Jun 2010)
New Revision: 12016

Modified:
   gnunet/src/topology/test_gnunet_daemon_topology.c
Log:
shutdown callback

Modified: gnunet/src/topology/test_gnunet_daemon_topology.c
===================================================================
--- gnunet/src/topology/test_gnunet_daemon_topology.c   2010-06-28 12:22:45 UTC 
(rev 12015)
+++ gnunet/src/topology/test_gnunet_daemon_topology.c   2010-06-28 12:23:08 UTC 
(rev 12016)
@@ -50,12 +50,35 @@
 
 static struct GNUNET_SCHEDULER_Handle *sched;
 
+/**
+ * Check whether peers successfully shut down.
+ */
+void shutdown_callback (void *cls,
+                        const char *emsg)
+{
+  if (emsg != NULL)
+    {
+#if VERBOSE
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                  "Shutdown of peers failed!\n");
+#endif
+      if (ok == 0)
+        ok = 666;
+    }
+  else
+    {
+#if VERBOSE
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                  "All peers successfully shut down!\n");
+#endif
+    }
+}
 
 static void
 clean_up_task (void *cls,
                 const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
-  GNUNET_TESTING_daemons_stop (pg, TIMEOUT);
+  GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
   ok = 0;     
 }
 
@@ -76,7 +99,7 @@
       fprintf (stderr,
               "Failed to connect two peers: %s\n",
               emsg);
-      GNUNET_TESTING_daemons_stop (pg, TIMEOUT);
+      GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
       GNUNET_assert (0);
       return;
     }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]