/*
This file is part of GNUnet.
- Copyright (C) 2009, 2010, 2011, 2016 GNUnet e.V.
+ Copyright (C) 2009, 2010, 2011, 2016, 2017 GNUnet e.V.
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
static void
transmit_request (struct ClientQueryRecord *cqr)
{
- int32_t reply_bf_mutator;
- struct GNUNET_CONTAINER_BloomFilter *reply_bf;
+ struct GNUNET_BLOCK_Group *bg;
struct GNUNET_CONTAINER_BloomFilter *peer_bf;
GNUNET_STATISTICS_update (GDS_stats,
gettext_noop ("# GET requests from clients injected"),
1,
GNUNET_NO);
- reply_bf_mutator =
- (int32_t) GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK,
- UINT32_MAX);
- reply_bf
- = GNUNET_BLOCK_construct_bloomfilter (reply_bf_mutator,
- cqr->seen_replies,
- cqr->seen_replies_count);
+ bg = GNUNET_BLOCK_group_create (GDS_block_context,
+ cqr->type,
+ GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK,
+ UINT32_MAX),
+ NULL,
+ 0,
+ "seen-set-size",
+ cqr->seen_replies_count,
+ NULL);
+ GNUNET_BLOCK_group_set_seen (bg,
+ cqr->seen_replies,
+ cqr->seen_replies_count);
peer_bf
= GNUNET_CONTAINER_bloomfilter_init (NULL,
DHT_BLOOM_SIZE,
&cqr->key,
cqr->xquery,
cqr->xquery_size,
- reply_bf,
- reply_bf_mutator,
+ bg,
peer_bf);
- GNUNET_CONTAINER_bloomfilter_free (reply_bf);
+ GNUNET_BLOCK_group_destroy (bg);
GNUNET_CONTAINER_bloomfilter_free (peer_bf);
/* exponential back-off for retries.
delay = GNUNET_TIME_absolute_get_remaining (cqr->retry_time);
if (delay.rel_value_us > 0)
{
- cqr->hnode =
- GNUNET_CONTAINER_heap_insert (retry_heap,
+ cqr->hnode
+ = GNUNET_CONTAINER_heap_insert (retry_heap,
cqr,
cqr->retry_time.abs_value_us);
- retry_task =
- GNUNET_SCHEDULER_add_delayed (delay,
- &transmit_next_request_task,
- NULL);
+ retry_task
+ = GNUNET_SCHEDULER_add_at (cqr->retry_time,
+ &transmit_next_request_task,
+ NULL);
return;
}
transmit_request (cqr);
cqr->hnode
- = GNUNET_CONTAINER_heap_insert (retry_heap, cqr,
+ = GNUNET_CONTAINER_heap_insert (retry_heap,
+ cqr,
cqr->retry_time.abs_value_us);
}
}
cqr->xquery,
xquery_size,
NULL,
- 0,
&handle_local_result,
ch);
GNUNET_SERVICE_client_continue (ch->client);
eval
= GNUNET_BLOCK_evaluate (GDS_block_context,
record->type,
+ NULL,
GNUNET_BLOCK_EO_NONE,
key,
- NULL,
- 0,
record->xquery,
record->xquery_size,
frc->data,