diff options
author | Julius Bünger <buenger@mytum.de> | 2015-02-16 18:56:22 +0000 |
---|---|---|
committer | Julius Bünger <buenger@mytum.de> | 2015-02-16 18:56:22 +0000 |
commit | f4215c5cfa1a76c75aee6ceff1da057f2fa20c2a (patch) | |
tree | 2ce680cb7d321b04faeb87dcce8ee9a0eb8e27a6 /src/rps/gnunet-service-rps_sampler.c | |
parent | 0f5f329643649dfadc85a89273b845d1854e8f6d (diff) |
- fixed slow startup of service
Diffstat (limited to 'src/rps/gnunet-service-rps_sampler.c')
-rw-r--r-- | src/rps/gnunet-service-rps_sampler.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/rps/gnunet-service-rps_sampler.c b/src/rps/gnunet-service-rps_sampler.c index 222a600bd..f1e48d9f8 100644 --- a/src/rps/gnunet-service-rps_sampler.c +++ b/src/rps/gnunet-service-rps_sampler.c @@ -610,7 +610,6 @@ sampler_get_rand_peer (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) uint32_t tmp_client_get_index; gpc->get_peer_task = NULL; - GNUNET_CONTAINER_DLL_remove (gpc_head, gpc_tail, gpc); if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) return; @@ -630,13 +629,14 @@ sampler_get_rand_peer (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) do { /* Get first non empty sampler */ if (tmp_client_get_index == client_get_index) - { + { /* We once cycled over the whole list */ LOG (GNUNET_ERROR_TYPE_DEBUG, "reached tmp_index %" PRIX32 ".\n", client_get_index); GNUNET_assert (NULL == gpc->get_peer_task); gpc->get_peer_task = GNUNET_SCHEDULER_add_delayed (gpc->sampler->max_round_interval, - &sampler_get_rand_peer, cls); + &sampler_get_rand_peer, + cls); return; } @@ -680,7 +680,8 @@ sampler_get_rand_peer (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) GNUNET_assert (NULL == gpc->get_peer_task); gpc->get_peer_task = GNUNET_SCHEDULER_add_delayed (gpc->sampler->max_round_interval, - &sampler_get_rand_peer, cls); + &sampler_get_rand_peer, + cls); return; } // TODO add other reasons to wait here @@ -688,6 +689,7 @@ sampler_get_rand_peer (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) s_elem->last_client_request = GNUNET_TIME_absolute_get (); + GNUNET_CONTAINER_DLL_remove (gpc_head, gpc_tail, gpc); gpc->cont (gpc->cont_cls, gpc->id); GNUNET_free (gpc); } |