-fix
authorChristian Grothoff <christian@grothoff.org>
Tue, 24 Apr 2012 13:01:06 +0000 (13:01 +0000)
committerChristian Grothoff <christian@grothoff.org>
Tue, 24 Apr 2012 13:01:06 +0000 (13:01 +0000)
src/hostlist/hostlist-client.c
src/hostlist/test_gnunet_daemon_hostlist_learning.c

index 5398e9aa52bb016217bc09bf5e24f595bce9573b..7f285f6cfba3c94921787d08840be9ecdf9849a1 100644 (file)
@@ -1437,6 +1437,7 @@ GNUNET_HOSTLIST_client_start (const struct GNUNET_CONFIGURATION_Handle *c,
   char *filename;
   int result;
 
+  GNUNET_assert (NULL != st);
   if (0 != curl_global_init (CURL_GLOBAL_WIN32))
   {
     GNUNET_break (0);
index 46dd86600f60bb5b4ccedb90b9e30a21559809e1..409a3ed701c2ffb337ab75308896c3d127e98f06 100644 (file)
@@ -191,6 +191,14 @@ process_downloads_done (void *cls, int success)
 }
 
 
+static void
+do_shutdown (void *cls,
+            const struct GNUNET_SCHEDULER_TaskContext *tc)
+{
+  shutdown_testcase ();
+}
+
+
 static int
 process_downloads (void *cls, const char *subsystem, const char *name,
                    uint64_t value, int is_persistent)
@@ -201,7 +209,9 @@ process_downloads (void *cls, const char *subsystem, const char *name,
                 "Peer has successfully downloaded advertised URI\n");
     learned_hostlist_downloaded = GNUNET_YES;
     if ((learned_hostlist_saved == GNUNET_YES) && (adv_sent == GNUNET_YES))
-      shutdown_testcase ();
+    {
+      GNUNET_SCHEDULER_add_now (&do_shutdown, NULL);
+    }
   }
   return GNUNET_OK;
 }