summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJulius Bünger <buenger@mytum.de>2015-02-17 03:38:40 +0000
committerJulius Bünger <buenger@mytum.de>2015-02-17 03:38:40 +0000
commit5c336ce9a914cdd62982844381fc6b8e77681c46 (patch)
tree568fcb0e6209a3eb0f1f970b8558af18baa34762 /src
parent9678cbd3c4826dda99eb5aff900bee602f5b25ec (diff)
- fixed logic
Diffstat (limited to 'src')
-rw-r--r--src/rps/gnunet-service-rps_sampler.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/rps/gnunet-service-rps_sampler.c b/src/rps/gnunet-service-rps_sampler.c
index f1e48d9f8..27c65fff6 100644
--- a/src/rps/gnunet-service-rps_sampler.c
+++ b/src/rps/gnunet-service-rps_sampler.c
@@ -605,6 +605,7 @@ sampler_get_rand_peer (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct GetPeerCls *gpc = (struct GetPeerCls *) cls;
struct GNUNET_PeerIdentity tmp_id;
+ unsigned int empty_flag;
struct RPS_SamplerElement *s_elem;
struct GNUNET_TIME_Relative last_request_diff;
uint32_t tmp_client_get_index;
@@ -641,10 +642,12 @@ sampler_get_rand_peer (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
}
tmp_id = gpc->sampler->sampler_elements[client_get_index]->peer_id;
+ empty_flag = gpc->sampler->sampler_elements[client_get_index]->is_empty;
RPS_sampler_elem_reinit (gpc->sampler->sampler_elements[client_get_index]);
- RPS_sampler_elem_next (gpc->sampler->sampler_elements[client_get_index],
- gpc->sampler,
- &tmp_id);
+ if (EMPTY != empty_flag)
+ RPS_sampler_elem_next (gpc->sampler->sampler_elements[client_get_index],
+ gpc->sampler,
+ &tmp_id);
/* Cycle the #client_get_index one step further */
if ( client_get_index == gpc->sampler->sampler_size - 1 )