gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r21119 - gnunet/src/topology
Date: Tue, 24 Apr 2012 13:49:57 +0200

Author: grothoff
Date: 2012-04-24 13:49:57 +0200 (Tue, 24 Apr 2012)
New Revision: 21119

Modified:
   gnunet/src/topology/gnunet-daemon-topology.c
Log:
-trying to fix assertion from freebsd buildbot

Modified: gnunet/src/topology/gnunet-daemon-topology.c
===================================================================
--- gnunet/src/topology/gnunet-daemon-topology.c        2012-04-24 11:40:45 UTC 
(rev 21118)
+++ gnunet/src/topology/gnunet-daemon-topology.c        2012-04-24 11:49:57 UTC 
(rev 21119)
@@ -305,6 +305,7 @@
 {
   struct Peer *pos = value;
 
+  GNUNET_break (GNUNET_NO == pos->is_connected);
   GNUNET_break (GNUNET_OK ==
                 GNUNET_CONTAINER_multihashmap_remove (peers, pid, pos));
   if (pos->hello_req != NULL)
@@ -646,7 +647,7 @@
   GNUNET_STATISTICS_set (stats, gettext_noop ("# peers connected"),
                          connection_count, GNUNET_NO);
   pos = GNUNET_CONTAINER_multihashmap_get (peers, &peer->hashPubKey);
-  if (pos == NULL)
+  if (NULL == pos)
   {
     pos = make_peer (peer, NULL, GNUNET_NO);
     GNUNET_break (GNUNET_OK == is_connection_allowed (pos));
@@ -721,7 +722,7 @@
               "Core told us that we disconnected from `%s'\n",
               GNUNET_i2s (peer));
   pos = GNUNET_CONTAINER_multihashmap_get (peers, &peer->hashPubKey);
-  if (pos == NULL)
+  if (NULL == pos)
   {
     GNUNET_break (0);
     return;
@@ -808,7 +809,7 @@
   if (GNUNET_NO == have_address)
     return;                     /* no point in advertising this one... */
   peer = GNUNET_CONTAINER_multihashmap_get (peers, &pid.hashPubKey);
-  if (peer == NULL)
+  if (NULL == peer)
   {
     peer = make_peer (&pid, hello, GNUNET_NO);
   }
@@ -882,7 +883,7 @@
         GNUNET_CONTAINER_bloomfilter_free (pos->filter);
         pos->filter = NULL;
       }
-      if ((!pos->is_connected) && (!pos->is_friend) &&
+      if ((GNUNET_NO == pos->is_connected) && (GNUNET_NO == pos->is_friend) &&
           (0 ==
            GNUNET_TIME_absolute_get_remaining (pos->
                                                greylisted_until).rel_value))
@@ -1105,7 +1106,7 @@
   GNUNET_STATISTICS_update (stats, gettext_noop ("# HELLO messages received"),
                             1, GNUNET_NO);
   peer = GNUNET_CONTAINER_multihashmap_get (peers, &pid.hashPubKey);
-  if (peer == NULL)
+  if (NULL == peer)
   {
     if ((GNUNET_YES == friends_only) || (friend_count < minimum_friend_count))
       return GNUNET_OK;
@@ -1192,14 +1193,15 @@
   }
   GNUNET_TRANSPORT_disconnect (transport);
   transport = NULL;
-  GNUNET_CONTAINER_multihashmap_iterate (peers, &free_peer, NULL);
-  GNUNET_CONTAINER_multihashmap_destroy (peers);
   if (handle != NULL)
   {
     GNUNET_CORE_disconnect (handle);
     handle = NULL;
   }
   whitelist_peers ();
+  GNUNET_CONTAINER_multihashmap_iterate (peers, &free_peer, NULL);
+  GNUNET_CONTAINER_multihashmap_destroy (peers);
+  peers = NULL;
   if (stats != NULL)
   {
     GNUNET_STATISTICS_destroy (stats, GNUNET_NO);




reply via email to

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