gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r35455 - gnunet/src/rps


From: gnunet
Subject: [GNUnet-SVN] r35455 - gnunet/src/rps
Date: Wed, 25 Mar 2015 21:52:43 +0100

Author: ch3
Date: 2015-03-25 21:52:43 +0100 (Wed, 25 Mar 2015)
New Revision: 35455

Modified:
   gnunet/src/rps/gnunet-service-rps.c
Log:
-malicious peer type 1 sending pushes

Modified: gnunet/src/rps/gnunet-service-rps.c
===================================================================
--- gnunet/src/rps/gnunet-service-rps.c 2015-03-25 17:19:54 UTC (rev 35454)
+++ gnunet/src/rps/gnunet-service-rps.c 2015-03-25 20:52:43 UTC (rev 35455)
@@ -397,10 +397,16 @@
 /**
  * If type is 2 this is the DLL of attacked peers
  */
-//static struct AttackedPeer *att_peers_head = NULL;
-//static struct AttackedPeer *att_peers_tail = NULL;
+static struct AttackedPeer *att_peers_head = NULL;
+static struct AttackedPeer *att_peers_tail = NULL;
 
 /**
+ * This index is used to point to an attacked peer to
+ * implement the round-robin-ish way to select attacked peers.
+ */
+static struct AttackedPeer *att_peer_index = NULL;
+
+/**
  * Number of attacked peers
  */
 //static uint32_t num_attacked_peers = 0;
@@ -1622,9 +1628,13 @@
     num_pushes = min (min (push_limit, /* FIXME: attacked peer */ 
num_mal_peers), GNUNET_CONSTANTS_MAX_CADET_MESSAGE_SIZE);
     for (i = 0 ; i < num_pushes ; i++)
     { /* Send PUSHes to attacked peers */
-      //GNUNET_CONTAINER_multihashmap_iterator_create
-      //send_push ();
+      if (att_peers_tail == att_peer_index)
+        att_peer_index = att_peers_head;
+      else
+        att_peer_index = att_peer_index->next;
 
+      send_push (att_peer_index->peer_id);
+
       // TODO send pulls
       // send_pull_request
     }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]