aboutsummaryrefslogtreecommitdiff
path: root/src/dht/gnunet-service-dht_clients.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-02-20 17:19:47 +0100
committerChristian Grothoff <christian@grothoff.org>2017-02-20 17:19:47 +0100
commitf6f7fbbe98c110867febbcca647da8308be123c7 (patch)
treeaf69447cf4f08c417197685855c097c132aea8a1 /src/dht/gnunet-service-dht_clients.c
parenta3882b58f1c5976677aa65b0af8a48e8e946b06e (diff)
downloadgnunet-f6f7fbbe98c110867febbcca647da8308be123c7.tar.gz
gnunet-f6f7fbbe98c110867febbcca647da8308be123c7.zip
completed big block refactoring in preparation for SET-BLOCK integration
Diffstat (limited to 'src/dht/gnunet-service-dht_clients.c')
-rw-r--r--src/dht/gnunet-service-dht_clients.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/src/dht/gnunet-service-dht_clients.c b/src/dht/gnunet-service-dht_clients.c
index 5ba4e5820..a42356e5f 100644
--- a/src/dht/gnunet-service-dht_clients.c
+++ b/src/dht/gnunet-service-dht_clients.c
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2009, 2010, 2011, 2016 GNUnet e.V. 3 Copyright (C) 2009, 2010, 2011, 2016, 2017 GNUnet e.V.
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published 6 it under the terms of the GNU General Public License as published
@@ -362,21 +362,22 @@ client_disconnect_cb (void *cls,
362static void 362static void
363transmit_request (struct ClientQueryRecord *cqr) 363transmit_request (struct ClientQueryRecord *cqr)
364{ 364{
365 int32_t reply_bf_mutator; 365 struct GNUNET_BLOCK_Group *bg;
366 struct GNUNET_CONTAINER_BloomFilter *reply_bf;
367 struct GNUNET_CONTAINER_BloomFilter *peer_bf; 366 struct GNUNET_CONTAINER_BloomFilter *peer_bf;
368 367
369 GNUNET_STATISTICS_update (GDS_stats, 368 GNUNET_STATISTICS_update (GDS_stats,
370 gettext_noop ("# GET requests from clients injected"), 369 gettext_noop ("# GET requests from clients injected"),
371 1, 370 1,
372 GNUNET_NO); 371 GNUNET_NO);
373 reply_bf_mutator = 372 bg = GNUNET_BLOCK_group_create (GDS_block_context,
374 (int32_t) GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 373 cqr->type,
375 UINT32_MAX); 374 GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK,
376 reply_bf 375 UINT32_MAX),
377 = GNUNET_BLOCK_construct_bloomfilter (reply_bf_mutator, 376 NULL,
378 cqr->seen_replies, 377 0);
379 cqr->seen_replies_count); 378 GNUNET_BLOCK_group_set_seen (bg,
379 cqr->seen_replies,
380 cqr->seen_replies_count);
380 peer_bf 381 peer_bf
381 = GNUNET_CONTAINER_bloomfilter_init (NULL, 382 = GNUNET_CONTAINER_bloomfilter_init (NULL,
382 DHT_BLOOM_SIZE, 383 DHT_BLOOM_SIZE,
@@ -393,10 +394,9 @@ transmit_request (struct ClientQueryRecord *cqr)
393 &cqr->key, 394 &cqr->key,
394 cqr->xquery, 395 cqr->xquery,
395 cqr->xquery_size, 396 cqr->xquery_size,
396 reply_bf, 397 bg,
397 reply_bf_mutator,
398 peer_bf); 398 peer_bf);
399 GNUNET_CONTAINER_bloomfilter_free (reply_bf); 399 GNUNET_BLOCK_group_destroy (bg);
400 GNUNET_CONTAINER_bloomfilter_free (peer_bf); 400 GNUNET_CONTAINER_bloomfilter_free (peer_bf);
401 401
402 /* exponential back-off for retries. 402 /* exponential back-off for retries.
@@ -668,7 +668,6 @@ handle_dht_local_get (void *cls,
668 cqr->xquery, 668 cqr->xquery,
669 xquery_size, 669 xquery_size,
670 NULL, 670 NULL,
671 0,
672 &handle_local_result, 671 &handle_local_result,
673 ch); 672 ch);
674 GNUNET_SERVICE_client_continue (ch->client); 673 GNUNET_SERVICE_client_continue (ch->client);
@@ -1052,10 +1051,9 @@ forward_reply (void *cls,
1052 eval 1051 eval
1053 = GNUNET_BLOCK_evaluate (GDS_block_context, 1052 = GNUNET_BLOCK_evaluate (GDS_block_context,
1054 record->type, 1053 record->type,
1054 NULL,
1055 GNUNET_BLOCK_EO_NONE, 1055 GNUNET_BLOCK_EO_NONE,
1056 key, 1056 key,
1057 NULL,
1058 0,
1059 record->xquery, 1057 record->xquery,
1060 record->xquery_size, 1058 record->xquery_size,
1061 frc->data, 1059 frc->data,