gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r36139 - gnunet/src/rps
Date: Tue, 28 Jul 2015 17:29:19 +0200

Author: harsha
Date: 2015-07-28 17:29:19 +0200 (Tue, 28 Jul 2015)
New Revision: 36139

Modified:
   gnunet/src/rps/gnunet-service-rps.c
   gnunet/src/rps/rps.h
   gnunet/src/rps/test_rps.c
Log:
more assertions

Modified: gnunet/src/rps/gnunet-service-rps.c
===================================================================
--- gnunet/src/rps/gnunet-service-rps.c 2015-07-28 15:04:15 UTC (rev 36138)
+++ gnunet/src/rps/gnunet-service-rps.c 2015-07-28 15:29:19 UTC (rev 36139)
@@ -410,7 +410,7 @@
 /**
  * Number of other malicious peers
  */
-static uint32_t num_mal_peers = 0;
+static uint32_t num_mal_peers;
 
 
 /**
@@ -1288,6 +1288,7 @@
   uint32_t size_needed;
   struct ClientContext *cli_ctx;
 
+  GNUNET_assert (NULL != reply_cls);
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "sampler returned %" PRIu32 " peers:\n",
        num_peers);
@@ -1415,6 +1416,7 @@
     GNUNET_break_op (0);
     GNUNET_SERVER_receive_done (client,
                                 GNUNET_SYSERR);
+    return;
   }
 
   LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -1989,6 +1991,7 @@
   LOG (GNUNET_ERROR_TYPE_DEBUG, "Going to execute next round maliciously type 
%" PRIu32 ".\n",
       mal_type);
 
+  GNUNET_assert (mal_type <= 3);
   /* Do malicious actions */
   if (1 == mal_type)
   { /* Try to maximise representation */

Modified: gnunet/src/rps/rps.h
===================================================================
--- gnunet/src/rps/rps.h        2015-07-28 15:04:15 UTC (rev 36138)
+++ gnunet/src/rps/rps.h        2015-07-28 15:29:19 UTC (rev 36139)
@@ -154,7 +154,8 @@
    */
   uint32_t num_peers GNUNET_PACKED;
 
-  /* Followed by num_peers * GNUNET_PeerIdentity */
+  /* Followed by num_peers * GNUNET_PeerIdentity when the type of malicious
+     behaviour is 1 */
 };
 #endif /* ENABLE_MALICIOUS */
 

Modified: gnunet/src/rps/test_rps.c
===================================================================
--- gnunet/src/rps/test_rps.c   2015-07-28 15:04:15 UTC (rev 36138)
+++ gnunet/src/rps/test_rps.c   2015-07-28 15:29:19 UTC (rev 36139)
@@ -1147,18 +1147,14 @@
     rps_peers[i].index = i;
     rps_peers[i].op =
       GNUNET_TESTBED_service_connect (&rps_peers[i],
-                                                                         
peers[i],
-                                                                         "rps",
-                                                                         
&rps_connect_complete_cb,
-                                                                         
&rps_peers[i],
-                                                                         
&rps_connect_adapter,
-                                                                         
&rps_disconnect_adapter,
-                                                                         
&rps_peers[i]);
+                                      peers[i],
+                                      "rps",
+                                      &rps_connect_complete_cb,
+                                      &rps_peers[i],
+                                      &rps_connect_adapter,
+                                      &rps_disconnect_adapter,
+                                      &rps_peers[i]);
   }
-
-  if (NULL != churn_task)
-    GNUNET_SCHEDULER_cancel (churn_task);
-
   GNUNET_SCHEDULER_add_delayed (timeout, &shutdown_task, NULL);
 }
 




reply via email to

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