aboutsummaryrefslogtreecommitdiff
path: root/src/rps
diff options
context:
space:
mode:
authorJulius Bünger <buenger@mytum.de>2015-01-07 14:00:15 +0000
committerJulius Bünger <buenger@mytum.de>2015-01-07 14:00:15 +0000
commit22621780b74a570bf160e067b14239602750ee3a (patch)
tree45833060674d166b23eb19d117a584851250324d /src/rps
parent6a08ce6a247df3247a9e89500a6381c9ca205bac (diff)
downloadgnunet-22621780b74a570bf160e067b14239602750ee3a.tar.gz
gnunet-22621780b74a570bf160e067b14239602750ee3a.zip
now sending push,pull to at least one peer/round
Diffstat (limited to 'src/rps')
-rw-r--r--src/rps/gnunet-service-rps.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c
index e1af57391..9f4c767e4 100644
--- a/src/rps/gnunet-service-rps.c
+++ b/src/rps/gnunet-service-rps.c
@@ -641,6 +641,7 @@ do_round(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
641 641
642 uint64_t i; 642 uint64_t i;
643 //unsigned int *n_arr; 643 //unsigned int *n_arr;
644 unsigned int n_peers; /* Number of peers we send pushes/pulls to */
644 struct GNUNET_RPS_P2P_PushMessage *push_msg; 645 struct GNUNET_RPS_P2P_PushMessage *push_msg;
645 struct GNUNET_RPS_P2P_PullRequestMessage *pull_msg; // FIXME Send empty message 646 struct GNUNET_RPS_P2P_PullRequestMessage *pull_msg; // FIXME Send empty message
646 struct GNUNET_MQ_Envelope *ev; 647 struct GNUNET_MQ_Envelope *ev;
@@ -658,10 +659,12 @@ do_round(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
658 659
659 /* Send PUSHes */ 660 /* Send PUSHes */
660 //n_arr = GNUNET_CRYPTO_random_permute(GNUNET_CRYPTO_QUALITY_STRONG, (unsigned int) gossip_list_size); 661 //n_arr = GNUNET_CRYPTO_random_permute(GNUNET_CRYPTO_QUALITY_STRONG, (unsigned int) gossip_list_size);
661 LOG(GNUNET_ERROR_TYPE_DEBUG, "Going to send pushes to %f (%f * %u) peers.\n", 662 n_peers = round (alpha * gossip_list_size);
662 alpha * gossip_list_size, alpha, gossip_list_size); 663 if (0 == n_peers)
663 // TODO send to at least one 664 n_peers = 1;
664 for ( i = 0 ; i < alpha * gossip_list_size ; i++ ) 665 LOG(GNUNET_ERROR_TYPE_DEBUG, "Going to send pushes to %u (%f * %u) peers.\n",
666 n_peers, alpha, gossip_list_size);
667 for ( i = 0 ; i < n_peers ; i++ )
665 { // TODO compute length 668 { // TODO compute length
666 peer = get_rand_peer (gossip_list, gossip_list_size); 669 peer = get_rand_peer (gossip_list, gossip_list_size);
667 if (own_identity != peer) 670 if (own_identity != peer)
@@ -684,10 +687,12 @@ do_round(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
684 687
685 /* Send PULL requests */ 688 /* Send PULL requests */
686 //n_arr = GNUNET_CRYPTO_random_permute(GNUNET_CRYPTO_QUALITY_STRONG, (unsigned int) sampler_list->size); 689 //n_arr = GNUNET_CRYPTO_random_permute(GNUNET_CRYPTO_QUALITY_STRONG, (unsigned int) sampler_list->size);
687 LOG (GNUNET_ERROR_TYPE_DEBUG, "Going to send pulls to %f (%f * %u) peers.\n", 690 n_peers = round (beta * gossip_list_size);
688 beta * gossip_list_size, beta, gossip_list_size); 691 if (0 == n_peers)
689 // TODO send to at least one 692 n_peers = 1;
690 for ( i = 0 ; i < beta * gossip_list_size ; i++ ) 693 LOG (GNUNET_ERROR_TYPE_DEBUG, "Going to send pulls to %u (%f * %u) peers.\n",
694 n_peers, beta, gossip_list_size);
695 for ( i = 0 ; i < n_peers ; i++ )
691 { // TODO compute length 696 { // TODO compute length
692 peer = get_rand_peer(gossip_list, gossip_list_size); 697 peer = get_rand_peer(gossip_list, gossip_list_size);
693 if (own_identity != peer) 698 if (own_identity != peer)