gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r17088 - gnunet/src/dht


From: gnunet
Subject: [GNUnet-SVN] r17088 - gnunet/src/dht
Date: Wed, 28 Sep 2011 10:57:33 +0200

Author: grothoff
Date: 2011-09-28 10:57:33 +0200 (Wed, 28 Sep 2011)
New Revision: 17088

Modified:
   gnunet/src/dht/gnunet-service-dht_hello.c
   gnunet/src/dht/gnunet-service-dht_neighbours.c
   gnunet/src/dht/test_dht_multipeer.c
Log:
stuff

Modified: gnunet/src/dht/gnunet-service-dht_hello.c
===================================================================
--- gnunet/src/dht/gnunet-service-dht_hello.c   2011-09-28 08:13:20 UTC (rev 
17087)
+++ gnunet/src/dht/gnunet-service-dht_hello.c   2011-09-28 08:57:33 UTC (rev 
17088)
@@ -52,6 +52,8 @@
 const struct GNUNET_HELLO_Message *
 GDS_HELLO_get (const struct GNUNET_PeerIdentity *peer)
 {
+  if (NULL == peer_to_hello)
+    return NULL;
   return GNUNET_CONTAINER_multihashmap_get (peer_to_hello,
                                            &peer->hashPubKey);
 }
@@ -133,10 +135,13 @@
     GNUNET_PEERINFO_notify_cancel (pnc);
     pnc = NULL;
   }
-  GNUNET_CONTAINER_multihashmap_iterate (peer_to_hello,
-                                        &free_hello,
-                                        NULL);
-  GNUNET_CONTAINER_multihashmap_destroy (peer_to_hello);
+  if (NULL != peer_to_hello)
+  {
+    GNUNET_CONTAINER_multihashmap_iterate (peer_to_hello,
+                                          &free_hello,
+                                          NULL);
+    GNUNET_CONTAINER_multihashmap_destroy (peer_to_hello);
+  }
 }
 
 /* end of gnunet-service-dht_hello.c */

Modified: gnunet/src/dht/gnunet-service-dht_neighbours.c
===================================================================
--- gnunet/src/dht/gnunet-service-dht_neighbours.c      2011-09-28 08:13:20 UTC 
(rev 17087)
+++ gnunet/src/dht/gnunet-service-dht_neighbours.c      2011-09-28 08:57:33 UTC 
(rev 17088)
@@ -1583,8 +1583,9 @@
   if (NULL != GDS_my_hello)
   {
     GNUNET_BLOCK_mingle_hash (&my_identity.hashPubKey, bf_mutator, &mhash);
-    if (GNUNET_YES != GNUNET_CONTAINER_bloomfilter_test (bf, &mhash))
-      
+    if ( (NULL == bf) ||
+        (GNUNET_YES != GNUNET_CONTAINER_bloomfilter_test (bf, &mhash)) )
+    {
       GDS_NEIGHBOURS_handle_reply (sender,
                                   GNUNET_BLOCK_TYPE_DHT_HELLO,
                                   GNUNET_TIME_relative_to_absolute 
(GNUNET_CONSTANTS_HELLO_ADDRESS_EXPIRATION),
@@ -1593,7 +1594,20 @@
                                   0, NULL,
                                   GDS_my_hello,
                                   GNUNET_HELLO_size ((const struct 
GNUNET_HELLO_Message*) GDS_my_hello));
+    }
+    else
+    {
+      GNUNET_STATISTICS_update (GDS_stats,
+                               gettext_noop ("# FIND PEER requests ignored due 
to Bloomfilter"), 1,
+                               GNUNET_NO);
+    }
   }
+  else
+  {
+    GNUNET_STATISTICS_update (GDS_stats,
+                             gettext_noop ("# FIND PEER requests ignored due 
to lack of HELLO"), 1,
+                             GNUNET_NO);
+  }
 
   /* then, also consider sending a random HELLO from the closest bucket */
   if (0 == memcmp (&my_identity.hashPubKey, key, sizeof (GNUNET_HashCode)))
@@ -1743,6 +1757,12 @@
                                       get->bf_mutator);
     }
   }
+  else
+  {
+    GNUNET_STATISTICS_update (GDS_stats,
+                             gettext_noop ("# P2P GET requests ONLY routed"), 
1,
+                             GNUNET_NO);
+  }
   
   /* P2P forwarding */
   if (eval != GNUNET_BLOCK_EVALUATION_OK_LAST)

Modified: gnunet/src/dht/test_dht_multipeer.c
===================================================================
--- gnunet/src/dht/test_dht_multipeer.c 2011-09-28 08:13:20 UTC (rev 17087)
+++ gnunet/src/dht/test_dht_multipeer.c 2011-09-28 08:57:33 UTC (rev 17088)
@@ -28,7 +28,7 @@
 #include "gnunet_dht_service.h"
 
 /* DEFINES */
-#define VERBOSE GNUNET_YES
+#define VERBOSE GNUNET_NO
 
 /* Timeout for entire testcase */
 #define TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MINUTES, 5)




reply via email to

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