summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulius Bünger <buenger@mytum.de>2015-05-19 22:41:22 +0000
committerJulius Bünger <buenger@mytum.de>2015-05-19 22:41:22 +0000
commit8d1c8560be5f3fcd3fedbfb398f273a71890e22b (patch)
tree2844b00a22b05a5cfee53f25a640ca08255ffe64
parenta6d4c5ada59770b22d5c1e0508c2ad87efdeb9b8 (diff)
-optical changes
-rw-r--r--src/rps/gnunet-service-rps.c19
-rw-r--r--src/rps/gnunet-service-rps_sampler.c2
-rw-r--r--src/rps/test_rps.c5
3 files changed, 15 insertions, 11 deletions
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c
index 46f3fdacb..eb0fb3d82 100644
--- a/src/rps/gnunet-service-rps.c
+++ b/src/rps/gnunet-service-rps.c
@@ -2048,27 +2048,28 @@ do_round (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
GNUNET_array_grow (gossip_list, gossip_list_size, second_border);
for (i = 0 ; i < first_border ; i++)
- { // TODO use RPS_sampler_get_n_rand_peers
- /* Update gossip list with peers received through PUSHes */
+ {/* Update gossip list with peers received through PUSHes */
r_index = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_STRONG,
- push_list_size);
+ push_list_size);
gossip_list[i] = push_list[r_index];
// TODO change the peer_flags accordingly
}
for (i = first_border ; i < second_border ; i++)
- {
- /* Update gossip list with peers received through PULLs */
+ {/* Update gossip list with peers received through PULLs */
r_index = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_STRONG,
- pull_list_size);
+ pull_list_size);
gossip_list[i] = pull_list[r_index];
// TODO change the peer_flags accordingly
}
for (i = second_border ; i < sampler_size_est_need ; i++)
- {
- /* Update gossip list with peers from history */
- RPS_sampler_get_n_rand_peers (prot_sampler, hist_update, NULL, 1, GNUNET_NO);
+ {/* Update gossip list with peers from history */
+ RPS_sampler_get_n_rand_peers (prot_sampler,
+ hist_update,
+ NULL,
+ 1,
+ GNUNET_NO);
num_hist_update_tasks++;
// TODO change the peer_flags accordingly
}
diff --git a/src/rps/gnunet-service-rps_sampler.c b/src/rps/gnunet-service-rps_sampler.c
index f851ac965..f960bd6c7 100644
--- a/src/rps/gnunet-service-rps_sampler.c
+++ b/src/rps/gnunet-service-rps_sampler.c
@@ -644,7 +644,7 @@ sampler_empty (struct RPS_Sampler *sampler)
*/
struct RPS_Sampler *
RPS_sampler_init (size_t init_size,
- struct GNUNET_TIME_Relative max_round_interval)
+ struct GNUNET_TIME_Relative max_round_interval)
{
struct RPS_Sampler *sampler;
//uint32_t i;
diff --git a/src/rps/test_rps.c b/src/rps/test_rps.c
index eb2d9d264..87b0620ee 100644
--- a/src/rps/test_rps.c
+++ b/src/rps/test_rps.c
@@ -318,7 +318,10 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
unsigned int i;
- for (i=0;i<NUM_PEERS;i++)
+ if (NULL != churn_task)
+ GNUNET_SCHEDULER_cancel (churn_task);
+
+ for (i = 0 ; i < num_peers ; i++)
GNUNET_TESTBED_operation_done (rps_peers[i].op);
GNUNET_SCHEDULER_shutdown ();
}