gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r16919 - gnunet/src/dht
Date: Sat, 17 Sep 2011 22:46:31 +0200

Author: grothoff
Date: 2011-09-17 22:46:31 +0200 (Sat, 17 Sep 2011)
New Revision: 16919

Modified:
   gnunet/src/dht/dht.h
   gnunet/src/dht/gnunet-service-dht.c
Log:
removing reply bf entirely, problem was with UID removal

Modified: gnunet/src/dht/dht.h
===================================================================
--- gnunet/src/dht/dht.h        2011-09-17 20:03:20 UTC (rev 16918)
+++ gnunet/src/dht/dht.h        2011-09-17 20:46:31 UTC (rev 16919)
@@ -34,15 +34,9 @@
  * Should NEVER be enabled in production and makes the DHT incompatible
  * (since this changes the message format).
  */
-#define HAVE_UID_FOR_TESTING GNUNET_NO
+#define HAVE_UID_FOR_TESTING GNUNET_YES
 
 /**
- * Include a bf for replies? Should not be needed (see Mantis #1769), but if I 
remove
- * this code it stops to work!?
- */
-#define HAVE_REPLY_BLOOMFILTER GNUNET_YES
-
-/**
  * Needs to be GNUNET_YES for logging to dhtlog to work!
  */
 #define DEBUG_DHT_ROUTING GNUNET_YES
@@ -334,14 +328,7 @@
   uint64_t unique_id GNUNET_PACKED;
 #endif
 
-#if HAVE_REPLY_BLOOMFILTER
   /**
-   * Bloomfilter to stop circular routes
-   */
-  char bloomfilter[DHT_BLOOM_SIZE];
-#endif
-
-  /**
    * The key that was searched for
    */
   GNUNET_HashCode key;

Modified: gnunet/src/dht/gnunet-service-dht.c
===================================================================
--- gnunet/src/dht/gnunet-service-dht.c 2011-09-17 20:03:20 UTC (rev 16918)
+++ gnunet/src/dht/gnunet-service-dht.c 2011-09-17 20:46:31 UTC (rev 16919)
@@ -1072,13 +1072,6 @@
   }
   result_message->options = htonl (msg_ctx->msg_options);
   result_message->hop_count = htonl (msg_ctx->hop_count + 1);
-#if HAVE_REPLY_BLOOMFILTER
-  GNUNET_assert (GNUNET_OK ==
-                 GNUNET_CONTAINER_bloomfilter_get_raw_data (msg_ctx->bloom,
-                                                            result_message->
-                                                            bloomfilter,
-                                                            DHT_BLOOM_SIZE));
-#endif
 #if HAVE_UID_FOR_TESTING 
   result_message->unique_id = GNUNET_htonll (msg_ctx->unique_id);
 #endif
@@ -1927,13 +1920,6 @@
                                    NULL);
     }
 #endif
-#if HAVE_REPLY_BLOOMFILTER
-    if (msg_ctx->bloom != NULL)
-    {
-      GNUNET_CONTAINER_bloomfilter_free (msg_ctx->bloom);
-      msg_ctx->bloom = NULL;
-    }
-#endif
     return 0;
   }
 
@@ -2000,18 +1986,6 @@
         pos = pos->next;
         continue;
       }
-#if HAVE_REPLY_BLOOMFILTER
-      if (msg_ctx->bloom == NULL)
-        msg_ctx->bloom =
-            GNUNET_CONTAINER_bloomfilter_init (NULL, DHT_BLOOM_SIZE,
-                                               DHT_BLOOM_K);
-      GNUNET_CONTAINER_bloomfilter_add (msg_ctx->bloom,
-                                        &my_identity.hashPubKey);
-      if ((GNUNET_NO ==
-           GNUNET_CONTAINER_bloomfilter_test (msg_ctx->bloom,
-                                              &peer_info->id.hashPubKey)))
-       {{{
-#endif
 #if DEBUG_DHT
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                  "`%s:%s': Forwarding response key %s uid %llu to peer %s\n",
@@ -2035,19 +2009,9 @@
        pos->delete_task =
          GNUNET_SCHEDULER_add_now (&remove_forward_entry, pos);        
       }
-#if HAVE_REPLY_BLOOMFILTER
-        }}}
-#endif
     }
     pos = pos->next;
   }
-#if HAVE_REPLY_BLOOMFILTER
-  if (msg_ctx->bloom != NULL)
-  {
-    GNUNET_CONTAINER_bloomfilter_free (msg_ctx->bloom);
-    msg_ctx->bloom = NULL;
-  }
-#endif
   return 0;
 }
 
@@ -3281,6 +3245,8 @@
 
 
   GNUNET_CONTAINER_bloomfilter_add (msg_ctx->bloom, &my_identity.hashPubKey);
+  /* BUG HERE: recent uses unique_id! So if all unique-IDs are 0, we get
+     easily into trouble!!! FIXME! */
   hash_from_uid (msg_ctx->unique_id, &unique_hash);
   if (GNUNET_YES ==
       GNUNET_CONTAINER_multihashmap_contains (recent.hashmap, &unique_hash))
@@ -4252,12 +4218,6 @@
     }
 #endif
   }
-#if HAVE_REPLY_BLOOMFILTER
-  msg_ctx.bloom =
-      GNUNET_CONTAINER_bloomfilter_init (incoming->bloomfilter, DHT_BLOOM_SIZE,
-                                         DHT_BLOOM_K);
-  GNUNET_assert (msg_ctx.bloom != NULL);
-#endif
   route_result_message (enc_msg, &msg_ctx);
   return GNUNET_YES;
 }




reply via email to

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