(no commit message)
authorMatthias Wachs <wachs@net.in.tum.de>
Mon, 17 May 2010 08:54:38 +0000 (08:54 +0000)
committerMatthias Wachs <wachs@net.in.tum.de>
Mon, 17 May 2010 08:54:38 +0000 (08:54 +0000)
src/hostlist/test_gnunet_daemon_hostlist_learning.c

index 12553ae9cfa984ea1a4a1d3645cbb00dc3a26023..1ab0f4edcb52bce8100280d09161cd98f6fc0411 100644 (file)
@@ -109,11 +109,12 @@ static void shutdown_testcase()
     GNUNET_SCHEDULER_cancel (sched, check_task);
     check_task = GNUNET_SCHEDULER_NO_TASK;
   }
-  if (NULL != download_stats)
+
+  if ((NULL != learn_peer.stats) && (NULL != download_stats))
     GNUNET_STATISTICS_get_cancel (download_stats);
-  if (NULL != urisrecv_stat)
+  if ((NULL != learn_peer.stats) && (NULL != urisrecv_stat))
     GNUNET_STATISTICS_get_cancel (urisrecv_stat);
-  if (NULL != advsent_stat)
+  if ((NULL != adv_peer.stats) && (NULL != advsent_stat))
     GNUNET_STATISTICS_get_cancel (advsent_stat);
   if ( NULL != current_adv_uri ) GNUNET_free (current_adv_uri);
 
@@ -167,7 +168,6 @@ process_downloads (void *cls,
               uint64_t value,
               int is_persistent)
 {
-
   download_stats = NULL;
   if ( ((struct PeerContext *) cls == &learn_peer) && (value == 2) && (learned_hostlist_downloaded == GNUNET_NO) )
   {
@@ -413,8 +413,6 @@ run (void *cls,
 
   sched = s;
 
-
-
   check_task = GNUNET_SCHEDULER_add_delayed (sched,
                                 CHECK_INTERVALL,
                                 &check_statistics,
@@ -426,7 +424,6 @@ run (void *cls,
                                                TIMEOUT,
                                                &timeout_error,
                                                NULL);
-
 }
 
 static int