diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2015-07-28 15:29:19 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2015-07-28 15:29:19 +0000 |
commit | 01a62e8e969eb749a850e6425e32cd7ef269ee9e (patch) | |
tree | dffb654a6f70cf49b41a0230ce9ba785b5ad587a /src/rps | |
parent | b7d7b8c0fc2985e922f8fb63a14b1b17386af069 (diff) | |
download | gnunet-01a62e8e969eb749a850e6425e32cd7ef269ee9e.tar.gz gnunet-01a62e8e969eb749a850e6425e32cd7ef269ee9e.zip |
more assertions
Diffstat (limited to 'src/rps')
-rw-r--r-- | src/rps/gnunet-service-rps.c | 5 | ||||
-rw-r--r-- | src/rps/rps.h | 3 | ||||
-rw-r--r-- | src/rps/test_rps.c | 18 |
3 files changed, 13 insertions, 13 deletions
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c index f0393bdf0..71903709a 100644 --- a/src/rps/gnunet-service-rps.c +++ b/src/rps/gnunet-service-rps.c | |||
@@ -410,7 +410,7 @@ static struct GNUNET_CONTAINER_MultiPeerMap *mal_peer_set = NULL; | |||
410 | /** | 410 | /** |
411 | * Number of other malicious peers | 411 | * Number of other malicious peers |
412 | */ | 412 | */ |
413 | static uint32_t num_mal_peers = 0; | 413 | static uint32_t num_mal_peers; |
414 | 414 | ||
415 | 415 | ||
416 | /** | 416 | /** |
@@ -1288,6 +1288,7 @@ void client_respond (void *cls, | |||
1288 | uint32_t size_needed; | 1288 | uint32_t size_needed; |
1289 | struct ClientContext *cli_ctx; | 1289 | struct ClientContext *cli_ctx; |
1290 | 1290 | ||
1291 | GNUNET_assert (NULL != reply_cls); | ||
1291 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1292 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1292 | "sampler returned %" PRIu32 " peers:\n", | 1293 | "sampler returned %" PRIu32 " peers:\n", |
1293 | num_peers); | 1294 | num_peers); |
@@ -1415,6 +1416,7 @@ handle_client_seed (void *cls, | |||
1415 | GNUNET_break_op (0); | 1416 | GNUNET_break_op (0); |
1416 | GNUNET_SERVER_receive_done (client, | 1417 | GNUNET_SERVER_receive_done (client, |
1417 | GNUNET_SYSERR); | 1418 | GNUNET_SYSERR); |
1419 | return; | ||
1418 | } | 1420 | } |
1419 | 1421 | ||
1420 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1422 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
@@ -1989,6 +1991,7 @@ do_mal_round (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1989 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Going to execute next round maliciously type %" PRIu32 ".\n", | 1991 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Going to execute next round maliciously type %" PRIu32 ".\n", |
1990 | mal_type); | 1992 | mal_type); |
1991 | 1993 | ||
1994 | GNUNET_assert (mal_type <= 3); | ||
1992 | /* Do malicious actions */ | 1995 | /* Do malicious actions */ |
1993 | if (1 == mal_type) | 1996 | if (1 == mal_type) |
1994 | { /* Try to maximise representation */ | 1997 | { /* Try to maximise representation */ |
diff --git a/src/rps/rps.h b/src/rps/rps.h index e1583d06c..9a16e7593 100644 --- a/src/rps/rps.h +++ b/src/rps/rps.h | |||
@@ -154,7 +154,8 @@ struct GNUNET_RPS_CS_ActMaliciousMessage | |||
154 | */ | 154 | */ |
155 | uint32_t num_peers GNUNET_PACKED; | 155 | uint32_t num_peers GNUNET_PACKED; |
156 | 156 | ||
157 | /* Followed by num_peers * GNUNET_PeerIdentity */ | 157 | /* Followed by num_peers * GNUNET_PeerIdentity when the type of malicious |
158 | behaviour is 1 */ | ||
158 | }; | 159 | }; |
159 | #endif /* ENABLE_MALICIOUS */ | 160 | #endif /* ENABLE_MALICIOUS */ |
160 | 161 | ||
diff --git a/src/rps/test_rps.c b/src/rps/test_rps.c index a430f4a83..108c1bd34 100644 --- a/src/rps/test_rps.c +++ b/src/rps/test_rps.c | |||
@@ -1147,18 +1147,14 @@ run (void *cls, | |||
1147 | rps_peers[i].index = i; | 1147 | rps_peers[i].index = i; |
1148 | rps_peers[i].op = | 1148 | rps_peers[i].op = |
1149 | GNUNET_TESTBED_service_connect (&rps_peers[i], | 1149 | GNUNET_TESTBED_service_connect (&rps_peers[i], |
1150 | peers[i], | 1150 | peers[i], |
1151 | "rps", | 1151 | "rps", |
1152 | &rps_connect_complete_cb, | 1152 | &rps_connect_complete_cb, |
1153 | &rps_peers[i], | 1153 | &rps_peers[i], |
1154 | &rps_connect_adapter, | 1154 | &rps_connect_adapter, |
1155 | &rps_disconnect_adapter, | 1155 | &rps_disconnect_adapter, |
1156 | &rps_peers[i]); | 1156 | &rps_peers[i]); |
1157 | } | 1157 | } |
1158 | |||
1159 | if (NULL != churn_task) | ||
1160 | GNUNET_SCHEDULER_cancel (churn_task); | ||
1161 | |||
1162 | GNUNET_SCHEDULER_add_delayed (timeout, &shutdown_task, NULL); | 1158 | GNUNET_SCHEDULER_add_delayed (timeout, &shutdown_task, NULL); |
1163 | } | 1159 | } |
1164 | 1160 | ||