summaryrefslogtreecommitdiff
path: root/src/rps/test_rps.c
diff options
context:
space:
mode:
authorJulius Bünger <buenger@mytum.de>2015-03-28 15:28:54 +0000
committerJulius Bünger <buenger@mytum.de>2015-03-28 15:28:54 +0000
commit4ebb81f479aaa9435e6c8927130c0617901b0cf5 (patch)
treee6dcadd3a7966347cae50322f907907f327e312c /src/rps/test_rps.c
parent3a30016f3eb61c60156d7f53237e3690662c2dcc (diff)
downloadgnunet-4ebb81f479aaa9435e6c8927130c0617901b0cf5.tar.gz
gnunet-4ebb81f479aaa9435e6c8927130c0617901b0cf5.zip
-fixes
Diffstat (limited to 'src/rps/test_rps.c')
-rw-r--r--src/rps/test_rps.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/rps/test_rps.c b/src/rps/test_rps.c
index 06df22583..52684bfde 100644
--- a/src/rps/test_rps.c
+++ b/src/rps/test_rps.c
@@ -309,7 +309,7 @@ rps_connect_complete_cb (void *cls,
309 309
310 #ifdef ENABLE_MALICIOUS 310 #ifdef ENABLE_MALICIOUS
311 if (1 == mal_type 311 if (1 == mal_type
312 || 1 == mal_type) 312 || 2 == mal_type)
313 { 313 {
314 GNUNET_assert (1 >= portion 314 GNUNET_assert (1 >= portion
315 && 0 < portion); 315 && 0 < portion);
@@ -318,9 +318,11 @@ rps_connect_complete_cb (void *cls,
318 if (rps_peer->index >= num_mal_peers) 318 if (rps_peer->index >= num_mal_peers)
319 { /* It's useless to ask a malicious peer about a random sample - 319 { /* It's useless to ask a malicious peer about a random sample -
320 it's not sampling */ 320 it's not sampling */
321 (void) GNUNET_RPS_request_peers (rps, 1, handle_reply, NULL); 321 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 2),
322 seed_peers, rps_peer);
323 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10),
324 request_peers, rps_peer);
322 } 325 }
323 return;
324 } 326 }
325 #endif /* ENABLE_MALICIOUS */ 327 #endif /* ENABLE_MALICIOUS */
326 328
@@ -352,10 +354,10 @@ rps_connect_complete_cb (void *cls,
352 } 354 }
353 else if (SEED_REQUEST == test_type) 355 else if (SEED_REQUEST == test_type)
354 { 356 {
355 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 2), 357 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 2),
356 seed_peers, rps_peer); 358 seed_peers, rps_peer);
357 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 15), 359 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 15),
358 request_peers, rps_peer); 360 request_peers, rps_peer);
359 } 361 }
360 else if (REQUEST_CANCEL == test_type) 362 else if (REQUEST_CANCEL == test_type)
361 { 363 {
@@ -545,14 +547,14 @@ main (int argc, char *argv[])
545 unsigned int num_mal_peers; 547 unsigned int num_mal_peers;
546 if (1 == mal_type) 548 if (1 == mal_type)
547 { 549 {
548 num_mal_peers = NUM_PEERS * portion; 550 num_mal_peers = round (NUM_PEERS * portion);
549 ok = evaluate (&rps_peers[num_mal_peers], 551 ok = evaluate (&rps_peers[num_mal_peers],
550 NUM_PEERS - (num_mal_peers), 552 NUM_PEERS - (num_mal_peers),
551 1); 553 1);
552 } 554 }
553 else if (2 == mal_type) 555 else if (2 == mal_type)
554 { 556 {
555 num_mal_peers = NUM_PEERS * portion; 557 num_mal_peers = round (NUM_PEERS * portion);
556 ok = evaluate (&rps_peers[num_mal_peers], 558 ok = evaluate (&rps_peers[num_mal_peers],
557 NUM_PEERS - (num_mal_peers), 559 NUM_PEERS - (num_mal_peers),
558 1); 560 1);