added LRN's patch from mantis bug 1998
authorMatthias Wachs <wachs@net.in.tum.de>
Mon, 19 Dec 2011 13:08:25 +0000 (13:08 +0000)
committerMatthias Wachs <wachs@net.in.tum.de>
Mon, 19 Dec 2011 13:08:25 +0000 (13:08 +0000)
src/hostlist/test_gnunet_daemon_hostlist.c

index cac2cc67a5f94ce5b7fe349fbcc914af5729e1df..91e0b3757260ee89d0b30228adce936c8794b8b7 100644 (file)
@@ -62,11 +62,21 @@ clean_up (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
   if (p1.th != NULL)
   {
+    if (p1.ghh != NULL)
+    {
+      GNUNET_TRANSPORT_get_hello_cancel (p1.ghh);
+      p1.ghh = NULL;
+    }
     GNUNET_TRANSPORT_disconnect (p1.th);
     p1.th = NULL;
   }
   if (p2.th != NULL)
   {
+    if (p2.ghh != NULL)
+    {
+      GNUNET_TRANSPORT_get_hello_cancel (p2.ghh);
+      p2.ghh = NULL;
+    }
     GNUNET_TRANSPORT_disconnect (p2.th);
     p2.th = NULL;
   }
@@ -118,6 +128,7 @@ process_hello (void *cls, const struct GNUNET_MessageHeader *message)
   struct PeerContext *p = cls;
 
   GNUNET_TRANSPORT_get_hello_cancel (p->ghh);
+  p->ghh = NULL;
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Received HELLO, starting hostlist service.\n");
 }