gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r9918 - in GNUnet/src: applications/dv/module server util/c


From: gnunet
Subject: [GNUnet-SVN] r9918 - in GNUnet/src: applications/dv/module server util/containers
Date: Tue, 29 Dec 2009 12:26:31 +0100

Author: grothoff
Date: 2009-12-29 12:26:31 +0100 (Tue, 29 Dec 2009)
New Revision: 9918

Modified:
   GNUnet/src/applications/dv/module/dv.c
   GNUnet/src/server/connection.c
   GNUnet/src/util/containers/multihashmap.c
Log:
cosmetics

Modified: GNUnet/src/applications/dv/module/dv.c
===================================================================
--- GNUnet/src/applications/dv/module/dv.c      2009-12-29 04:12:20 UTC (rev 
9917)
+++ GNUnet/src/applications/dv/module/dv.c      2009-12-29 11:26:31 UTC (rev 
9918)
@@ -39,10 +39,15 @@
  * peers?  This is good for better anonymity (network harder to
  * analyze for attackers), but likely not so good for testing DV...
  */
-#define SUPPORT_HIDING GNUNET_NO
+#define SUPPORT_HIDING GNUNET_YES
 
 #define DEBUG_DV GNUNET_NO
 
+/**
+ * Enable checks that in theory should not fail but we know to 
+ * fail but are harmless (and warning would confuse users).
+ */ 
+#define STRICT GNUNET_NO
 
 /**
  * How often do we check about sending out more peer information (if
@@ -454,6 +459,7 @@
       sender_id = source->our_id;
     }
 
+  cost = target->cost;
   toSend = GNUNET_malloc (msg_size);
   toSend->header.size = htons (msg_size);
   toSend->header.type = htons (GNUNET_P2P_PROTO_DV_DATA_MESSAGE);
@@ -465,7 +471,6 @@
   if (stats != NULL)
     stats->change (stat_dv_actual_sent_messages, 1);
   GNUNET_free (toSend);
-  cost = target->cost;
   GNUNET_mutex_unlock (ctx.dvMutex);
   return (int) cost;
 }
@@ -535,7 +540,9 @@
                                   &sender->hashPubKey);
   if (dn == NULL)
     {
+#if STRICT
       GNUNET_GE_BREAK (NULL, 0);
+#endif
       GNUNET_mutex_unlock (ctx.dvMutex);
       return GNUNET_OK;
     }
@@ -806,7 +813,9 @@
     stats->change (stat_dv_received_gossips, 1);
   neighbor = GNUNET_multi_hash_map_get (ctx.direct_neighbors,
                                         &sender->hashPubKey);
+#if STRICT
   GNUNET_GE_BREAK (NULL, neighbor != NULL);
+#endif
   if (neighbor == NULL)
     return GNUNET_OK;
   addUpdateNeighbor (&nmsg->neighbor,

Modified: GNUnet/src/server/connection.c
===================================================================
--- GNUnet/src/server/connection.c      2009-12-29 04:12:20 UTC (rev 9917)
+++ GNUnet/src/server/connection.c      2009-12-29 11:26:31 UTC (rev 9918)
@@ -1690,6 +1690,8 @@
     transport->connect_freely (&be->session.sender, GNUNET_NO, __FILE__);
   if (be->session.tsession == NULL)
     {
+      if (be->status == STAT_UP)
+       notify_disconnect (be);
       be->status = STAT_DOWN;
       be->time_established = 0;
       return GNUNET_NO;

Modified: GNUnet/src/util/containers/multihashmap.c
===================================================================
--- GNUnet/src/util/containers/multihashmap.c   2009-12-29 04:12:20 UTC (rev 
9917)
+++ GNUnet/src/util/containers/multihashmap.c   2009-12-29 11:26:31 UTC (rev 
9918)
@@ -110,6 +110,7 @@
   int count;
   unsigned int i;
   struct MapEntry *e;
+  struct MapEntry *nxt;
 
   count = 0;
   for (i = 0; i < map->map_length; i++)
@@ -117,10 +118,11 @@
       e = map->map[i];
       while (e != NULL)
         {
+         nxt = e->next;
           if ((NULL != it) && (GNUNET_OK != it (&e->key, e->value, cls)))
             return GNUNET_SYSERR;
           count++;
-          e = e->next;
+          e = nxt;
         }
     }
   return count;





reply via email to

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