summaryrefslogtreecommitdiff
path: root/src/rps/gnunet-service-rps_sampler.c
diff options
context:
space:
mode:
authorJulius Bünger <buenger@mytum.de>2018-08-24 12:47:54 +0200
committerJulius Bünger <buenger@mytum.de>2018-08-24 12:47:54 +0200
commitdc86c377a63e79ab2d17ce644ea060d1ce0c6b0c (patch)
tree51dfb1671a70af89076d14be05018035662b835f /src/rps/gnunet-service-rps_sampler.c
parentccd23df541fac1192f492b0169cb87f0f23a726d (diff)
Reinitialise the (client) sampler element after querying
Diffstat (limited to 'src/rps/gnunet-service-rps_sampler.c')
-rw-r--r--src/rps/gnunet-service-rps_sampler.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/rps/gnunet-service-rps_sampler.c b/src/rps/gnunet-service-rps_sampler.c
index 4d1ae4650..2974c3cbc 100644
--- a/src/rps/gnunet-service-rps_sampler.c
+++ b/src/rps/gnunet-service-rps_sampler.c
@@ -254,9 +254,10 @@ static uint32_t client_get_index;
*/
static void
check_n_peers_ready (void *cls,
- const struct GNUNET_PeerIdentity *id)
+ const struct GNUNET_PeerIdentity *id)
{
struct RPS_SamplerRequestHandle *req_handle = cls;
+ (void) id;
req_handle->cur_num_peers++;
LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -571,8 +572,7 @@ sampler_get_rand_peer (void *cls)
/**
* Get one random peer out of the sampled peers.
*
- * We might want to reinitialise this sampler after giving the
- * corrsponding peer to the client.
+ * This reinitialises the queried sampler element.
*/
static void
sampler_mod_get_rand_peer (void *cls)
@@ -635,6 +635,7 @@ sampler_mod_get_rand_peer (void *cls)
}
s_elem->last_client_request = GNUNET_TIME_absolute_get ();
+ RPS_sampler_elem_reinit (s_elem);
GNUNET_CONTAINER_DLL_remove (gpc->req_handle->gpc_head,
gpc->req_handle->gpc_tail,