diff options
Diffstat (limited to 'src/dht/gnunet-service-dht.c')
-rw-r--r-- | src/dht/gnunet-service-dht.c | 44 |
1 files changed, 2 insertions, 42 deletions
diff --git a/src/dht/gnunet-service-dht.c b/src/dht/gnunet-service-dht.c index d1d054a8b..489d51440 100644 --- a/src/dht/gnunet-service-dht.c +++ b/src/dht/gnunet-service-dht.c | |||
@@ -1072,13 +1072,6 @@ forward_result_message (const struct GNUNET_MessageHeader *msg, | |||
1072 | } | 1072 | } |
1073 | result_message->options = htonl (msg_ctx->msg_options); | 1073 | result_message->options = htonl (msg_ctx->msg_options); |
1074 | result_message->hop_count = htonl (msg_ctx->hop_count + 1); | 1074 | result_message->hop_count = htonl (msg_ctx->hop_count + 1); |
1075 | #if HAVE_REPLY_BLOOMFILTER | ||
1076 | GNUNET_assert (GNUNET_OK == | ||
1077 | GNUNET_CONTAINER_bloomfilter_get_raw_data (msg_ctx->bloom, | ||
1078 | result_message-> | ||
1079 | bloomfilter, | ||
1080 | DHT_BLOOM_SIZE)); | ||
1081 | #endif | ||
1082 | #if HAVE_UID_FOR_TESTING | 1075 | #if HAVE_UID_FOR_TESTING |
1083 | result_message->unique_id = GNUNET_htonll (msg_ctx->unique_id); | 1076 | result_message->unique_id = GNUNET_htonll (msg_ctx->unique_id); |
1084 | #endif | 1077 | #endif |
@@ -1927,13 +1920,6 @@ route_result_message (struct GNUNET_MessageHeader *msg, | |||
1927 | NULL); | 1920 | NULL); |
1928 | } | 1921 | } |
1929 | #endif | 1922 | #endif |
1930 | #if HAVE_REPLY_BLOOMFILTER | ||
1931 | if (msg_ctx->bloom != NULL) | ||
1932 | { | ||
1933 | GNUNET_CONTAINER_bloomfilter_free (msg_ctx->bloom); | ||
1934 | msg_ctx->bloom = NULL; | ||
1935 | } | ||
1936 | #endif | ||
1937 | return 0; | 1923 | return 0; |
1938 | } | 1924 | } |
1939 | 1925 | ||
@@ -2000,18 +1986,6 @@ route_result_message (struct GNUNET_MessageHeader *msg, | |||
2000 | pos = pos->next; | 1986 | pos = pos->next; |
2001 | continue; | 1987 | continue; |
2002 | } | 1988 | } |
2003 | #if HAVE_REPLY_BLOOMFILTER | ||
2004 | if (msg_ctx->bloom == NULL) | ||
2005 | msg_ctx->bloom = | ||
2006 | GNUNET_CONTAINER_bloomfilter_init (NULL, DHT_BLOOM_SIZE, | ||
2007 | DHT_BLOOM_K); | ||
2008 | GNUNET_CONTAINER_bloomfilter_add (msg_ctx->bloom, | ||
2009 | &my_identity.hashPubKey); | ||
2010 | if ((GNUNET_NO == | ||
2011 | GNUNET_CONTAINER_bloomfilter_test (msg_ctx->bloom, | ||
2012 | &peer_info->id.hashPubKey))) | ||
2013 | {{{ | ||
2014 | #endif | ||
2015 | #if DEBUG_DHT | 1989 | #if DEBUG_DHT |
2016 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1990 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2017 | "`%s:%s': Forwarding response key %s uid %llu to peer %s\n", | 1991 | "`%s:%s': Forwarding response key %s uid %llu to peer %s\n", |
@@ -2035,19 +2009,9 @@ route_result_message (struct GNUNET_MessageHeader *msg, | |||
2035 | pos->delete_task = | 2009 | pos->delete_task = |
2036 | GNUNET_SCHEDULER_add_now (&remove_forward_entry, pos); | 2010 | GNUNET_SCHEDULER_add_now (&remove_forward_entry, pos); |
2037 | } | 2011 | } |
2038 | #if HAVE_REPLY_BLOOMFILTER | ||
2039 | }}} | ||
2040 | #endif | ||
2041 | } | 2012 | } |
2042 | pos = pos->next; | 2013 | pos = pos->next; |
2043 | } | 2014 | } |
2044 | #if HAVE_REPLY_BLOOMFILTER | ||
2045 | if (msg_ctx->bloom != NULL) | ||
2046 | { | ||
2047 | GNUNET_CONTAINER_bloomfilter_free (msg_ctx->bloom); | ||
2048 | msg_ctx->bloom = NULL; | ||
2049 | } | ||
2050 | #endif | ||
2051 | return 0; | 2015 | return 0; |
2052 | } | 2016 | } |
2053 | 2017 | ||
@@ -3281,6 +3245,8 @@ route_message (const struct GNUNET_MessageHeader *msg, | |||
3281 | 3245 | ||
3282 | 3246 | ||
3283 | GNUNET_CONTAINER_bloomfilter_add (msg_ctx->bloom, &my_identity.hashPubKey); | 3247 | GNUNET_CONTAINER_bloomfilter_add (msg_ctx->bloom, &my_identity.hashPubKey); |
3248 | /* BUG HERE: recent uses unique_id! So if all unique-IDs are 0, we get | ||
3249 | easily into trouble!!! FIXME! */ | ||
3284 | hash_from_uid (msg_ctx->unique_id, &unique_hash); | 3250 | hash_from_uid (msg_ctx->unique_id, &unique_hash); |
3285 | if (GNUNET_YES == | 3251 | if (GNUNET_YES == |
3286 | GNUNET_CONTAINER_multihashmap_contains (recent.hashmap, &unique_hash)) | 3252 | GNUNET_CONTAINER_multihashmap_contains (recent.hashmap, &unique_hash)) |
@@ -4252,12 +4218,6 @@ handle_dht_p2p_route_result (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
4252 | } | 4218 | } |
4253 | #endif | 4219 | #endif |
4254 | } | 4220 | } |
4255 | #if HAVE_REPLY_BLOOMFILTER | ||
4256 | msg_ctx.bloom = | ||
4257 | GNUNET_CONTAINER_bloomfilter_init (incoming->bloomfilter, DHT_BLOOM_SIZE, | ||
4258 | DHT_BLOOM_K); | ||
4259 | GNUNET_assert (msg_ctx.bloom != NULL); | ||
4260 | #endif | ||
4261 | route_result_message (enc_msg, &msg_ctx); | 4221 | route_result_message (enc_msg, &msg_ctx); |
4262 | return GNUNET_YES; | 4222 | return GNUNET_YES; |
4263 | } | 4223 | } |