aboutsummaryrefslogtreecommitdiff
path: root/src/rps
diff options
context:
space:
mode:
authorJulius Bünger <buenger@mytum.de>2018-08-10 12:44:51 +0200
committerJulius Bünger <buenger@mytum.de>2018-08-13 14:33:04 +0200
commit8275d52ec81b53f46b799facc8c051829ded6eed (patch)
treee9fe0c8871a5938cb56fe8ce2f2ff2d9f3c7f735 /src/rps
parent341c1dd692c62a88eeff34fca155ce2377677d4b (diff)
downloadgnunet-8275d52ec81b53f46b799facc8c051829ded6eed.tar.gz
gnunet-8275d52ec81b53f46b799facc8c051829ded6eed.zip
Use synchronised logic for closing channels (rps service)
Diffstat (limited to 'src/rps')
-rw-r--r--src/rps/gnunet-rps-profiler.c20
-rw-r--r--src/rps/gnunet-service-rps.c248
-rw-r--r--src/rps/gnunet-service-rps_custommap.c1
-rw-r--r--src/rps/rps-test_util.c2
-rw-r--r--src/rps/test_rps.c2
-rw-r--r--src/rps/test_rps.conf1
6 files changed, 94 insertions, 180 deletions
diff --git a/src/rps/gnunet-rps-profiler.c b/src/rps/gnunet-rps-profiler.c
index 49714872f..277688b56 100644
--- a/src/rps/gnunet-rps-profiler.c
+++ b/src/rps/gnunet-rps-profiler.c
@@ -2311,14 +2311,14 @@ void write_final_stats (void){
2311 2311
2312 for (uint32_t i = 0; i < num_peers; i++) 2312 for (uint32_t i = 0; i < num_peers; i++)
2313 { 2313 {
2314 to_file ("/tmp/rps/final_stats.dat", 2314 to_file ("/tmp/rps/final_stats.csv",
2315 "%" PRIu32 " " /* index */ 2315 ", %" PRIu32 ", " /* index */
2316 "%s %" /* id */ 2316 "%s, %" /* id */
2317 PRIu64 " %" /* rounds */ 2317 PRIu64 ", %" /* rounds */
2318 PRIu64 " %" PRIu64 " %" PRIu64 " %" PRIu64 " %" PRIu64 " %" PRIu64 " %" /* blocking */ 2318 PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" /* blocking */
2319 PRIu64 " %" PRIu64 " %" PRIu64 " %" /* issued */ 2319 PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" /* issued */
2320 PRIu64 " %" PRIu64 " %" PRIu64 " %" /* sent */ 2320 PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" /* sent */
2321 PRIu64 " %" PRIu64 " %" PRIu64 /* recv */, 2321 PRIu64 ", %" PRIu64 ", %" PRIu64 /* recv */,
2322 i, 2322 i,
2323 GNUNET_i2s (rps_peers[i].peer_id), 2323 GNUNET_i2s (rps_peers[i].peer_id),
2324 rps_peers[i].stats[STAT_TYPE_ROUNDS], 2324 rps_peers[i].stats[STAT_TYPE_ROUNDS],
@@ -2407,10 +2407,10 @@ post_test_shutdown_ready_cb (void *cls,
2407 GNUNET_TESTBED_operation_done (rps_peer->stat_op); 2407 GNUNET_TESTBED_operation_done (rps_peer->stat_op);
2408 } 2408 }
2409 2409
2410 write_final_stats (); 2410 //write_final_stats ();
2411 if (GNUNET_YES == check_statistics_collect_completed()) 2411 if (GNUNET_YES == check_statistics_collect_completed())
2412 { 2412 {
2413 //write_final_stats (); 2413 write_final_stats ();
2414 GNUNET_free (stat_cls); 2414 GNUNET_free (stat_cls);
2415 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2415 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2416 "Shutting down\n"); 2416 "Shutting down\n");
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c
index 6b0ecc58c..8e8320a53 100644
--- a/src/rps/gnunet-service-rps.c
+++ b/src/rps/gnunet-service-rps.c
@@ -233,11 +233,6 @@ struct PeerContext
233 struct PendingMessage *pending_messages_tail; 233 struct PendingMessage *pending_messages_tail;
234 234
235 /** 235 /**
236 * @brief Task to destroy this context.
237 */
238 struct GNUNET_SCHEDULER_Task *destruction_task;
239
240 /**
241 * This is pobably followed by 'statistical' data (when we first saw 236 * This is pobably followed by 'statistical' data (when we first saw
242 * it, how did we get its ID, how many pushes (in a timeinterval), 237 * it, how did we get its ID, how many pushes (in a timeinterval),
243 * ...) 238 * ...)
@@ -280,11 +275,6 @@ struct ChannelCtx
280 * @brief The peer context associated with the channel 275 * @brief The peer context associated with the channel
281 */ 276 */
282 struct PeerContext *peer_ctx; 277 struct PeerContext *peer_ctx;
283
284 /**
285 * @brief Scheduled task that will destroy this context
286 */
287 struct GNUNET_SCHEDULER_Task *destruction_task;
288}; 278};
289 279
290/** 280/**
@@ -335,8 +325,28 @@ get_peer_ctx (const struct GNUNET_PeerIdentity *peer)
335 return ctx; 325 return ctx;
336} 326}
337 327
338int 328/**
339Peers_check_peer_known (const struct GNUNET_PeerIdentity *peer); 329 * @brief Check whether we have information about the given peer.
330 *
331 * FIXME probably deprecated. Make this the new _online.
332 *
333 * @param peer peer in question
334 *
335 * @return #GNUNET_YES if peer is known
336 * #GNUNET_NO if peer is not knwon
337 */
338static int
339Peers_check_peer_known (const struct GNUNET_PeerIdentity *peer)
340{
341 if (NULL != peer_map)
342 {
343 return GNUNET_CONTAINER_multipeermap_contains (peer_map, peer);
344 } else
345 {
346 return GNUNET_NO;
347 }
348}
349
340 350
341/** 351/**
342 * @brief Create a new #PeerContext and insert it into the peer map 352 * @brief Create a new #PeerContext and insert it into the peer map
@@ -379,11 +389,37 @@ create_or_get_peer_ctx (const struct GNUNET_PeerIdentity *peer)
379 return get_peer_ctx (peer); 389 return get_peer_ctx (peer);
380} 390}
381 391
382void
383Peers_unset_peer_flag (const struct GNUNET_PeerIdentity *peer, enum Peers_PeerFlags flags);
384 392
385void 393/**
386Peers_set_peer_flag (const struct GNUNET_PeerIdentity *peer, enum Peers_PeerFlags flags); 394 * @brief unset flags on a given peer.
395 *
396 * @param peer the peer to unset flags on
397 * @param flags the flags
398 */
399static void
400Peers_unset_peer_flag (const struct GNUNET_PeerIdentity *peer, enum Peers_PeerFlags flags)
401{
402 struct PeerContext *peer_ctx;
403
404 peer_ctx = get_peer_ctx (peer);
405 unset_peer_flag (peer_ctx, flags);
406}
407
408
409/**
410 * @brief set flags on a given peer.
411 *
412 * @param peer the peer to set flags on
413 * @param flags the flags
414 */
415static void
416Peers_set_peer_flag (const struct GNUNET_PeerIdentity *peer, enum Peers_PeerFlags flags)
417{
418 struct PeerContext *peer_ctx;
419
420 peer_ctx = get_peer_ctx (peer);
421 set_peer_flag (peer_ctx, flags);
422}
387 423
388/** 424/**
389 * @brief Check whether we have a connection to this @a peer 425 * @brief Check whether we have a connection to this @a peer
@@ -395,7 +431,7 @@ Peers_set_peer_flag (const struct GNUNET_PeerIdentity *peer, enum Peers_PeerFlag
395 * @return #GNUNET_YES if we are connected 431 * @return #GNUNET_YES if we are connected
396 * #GNUNET_NO otherwise 432 * #GNUNET_NO otherwise
397 */ 433 */
398int 434static int
399Peers_check_connected (const struct GNUNET_PeerIdentity *peer) 435Peers_check_connected (const struct GNUNET_PeerIdentity *peer)
400{ 436{
401 const struct PeerContext *peer_ctx; 437 const struct PeerContext *peer_ctx;
@@ -1084,7 +1120,7 @@ restore_valid_peers ()
1084 * @param cadet_h cadet handle 1120 * @param cadet_h cadet handle
1085 * @param own_id own peer identity 1121 * @param own_id own peer identity
1086 */ 1122 */
1087void 1123static void
1088Peers_initialise (char* fn_valid_peers, 1124Peers_initialise (char* fn_valid_peers,
1089 struct GNUNET_CADET_Handle *cadet_h) 1125 struct GNUNET_CADET_Handle *cadet_h)
1090{ 1126{
@@ -1150,7 +1186,7 @@ valid_peer_iterator (void *cls,
1150 * @return the number of key value pairs processed, 1186 * @return the number of key value pairs processed,
1151 * #GNUNET_SYSERR if it aborted iteration 1187 * #GNUNET_SYSERR if it aborted iteration
1152 */ 1188 */
1153int 1189static int
1154Peers_get_valid_peers (PeersIterator iterator, 1190Peers_get_valid_peers (PeersIterator iterator,
1155 void *it_cls) 1191 void *it_cls)
1156{ 1192{
@@ -1179,7 +1215,7 @@ Peers_get_valid_peers (PeersIterator iterator,
1179 * @return #GNUNET_YES if peer was inserted 1215 * @return #GNUNET_YES if peer was inserted
1180 * #GNUNET_NO otherwise 1216 * #GNUNET_NO otherwise
1181 */ 1217 */
1182int 1218static int
1183Peers_insert_peer (const struct GNUNET_PeerIdentity *peer) 1219Peers_insert_peer (const struct GNUNET_PeerIdentity *peer)
1184{ 1220{
1185 if (GNUNET_YES == Peers_check_peer_known (peer)) 1221 if (GNUNET_YES == Peers_check_peer_known (peer))
@@ -1190,7 +1226,7 @@ Peers_insert_peer (const struct GNUNET_PeerIdentity *peer)
1190 return GNUNET_YES; 1226 return GNUNET_YES;
1191} 1227}
1192 1228
1193int 1229static int
1194Peers_check_peer_flag (const struct GNUNET_PeerIdentity *peer, enum Peers_PeerFlags flags); 1230Peers_check_peer_flag (const struct GNUNET_PeerIdentity *peer, enum Peers_PeerFlags flags);
1195 1231
1196/** 1232/**
@@ -1202,7 +1238,7 @@ Peers_check_peer_flag (const struct GNUNET_PeerIdentity *peer, enum Peers_PeerFl
1202 * @return #GNUNET_YES if peer had to be inserted 1238 * @return #GNUNET_YES if peer had to be inserted
1203 * #GNUNET_NO otherwise 1239 * #GNUNET_NO otherwise
1204 */ 1240 */
1205int 1241static int
1206Peers_issue_peer_liveliness_check (const struct GNUNET_PeerIdentity *peer) 1242Peers_issue_peer_liveliness_check (const struct GNUNET_PeerIdentity *peer)
1207{ 1243{
1208 struct PeerContext *peer_ctx; 1244 struct PeerContext *peer_ctx;
@@ -1232,7 +1268,7 @@ Peers_issue_peer_liveliness_check (const struct GNUNET_PeerIdentity *peer)
1232 * #GNUNET_NO if peer is NOT removable 1268 * #GNUNET_NO if peer is NOT removable
1233 * #GNUNET_SYSERR if peer is not known 1269 * #GNUNET_SYSERR if peer is not known
1234 */ 1270 */
1235int 1271static int
1236Peers_check_removable (const struct GNUNET_PeerIdentity *peer) 1272Peers_check_removable (const struct GNUNET_PeerIdentity *peer)
1237{ 1273{
1238 struct PeerContext *peer_ctx; 1274 struct PeerContext *peer_ctx;
@@ -1252,11 +1288,11 @@ Peers_check_removable (const struct GNUNET_PeerIdentity *peer)
1252 return GNUNET_YES; 1288 return GNUNET_YES;
1253} 1289}
1254 1290
1255uint32_t * 1291static uint32_t *
1256Peers_get_channel_flag (const struct GNUNET_PeerIdentity *peer, 1292Peers_get_channel_flag (const struct GNUNET_PeerIdentity *peer,
1257 enum Peers_ChannelRole role); 1293 enum Peers_ChannelRole role);
1258 1294
1259int 1295static int
1260Peers_check_channel_flag (uint32_t *channel_flags, enum Peers_ChannelFlags flags); 1296Peers_check_channel_flag (uint32_t *channel_flags, enum Peers_ChannelFlags flags);
1261 1297
1262/** 1298/**
@@ -1270,54 +1306,26 @@ destroy_peer (void *cls)
1270 struct PeerContext *peer_ctx = cls; 1306 struct PeerContext *peer_ctx = cls;
1271 1307
1272 GNUNET_assert (NULL != peer_ctx); 1308 GNUNET_assert (NULL != peer_ctx);
1273 peer_ctx->destruction_task = NULL;
1274 Peers_remove_peer (&peer_ctx->peer_id); 1309 Peers_remove_peer (&peer_ctx->peer_id);
1275} 1310}
1276 1311
1277 1312
1278static void
1279destroy_channel (void *cls);
1280
1281
1282/** 1313/**
1283 * @brief Schedule the destruction of the given channel. 1314 * @brief Callback for scheduler to destroy a channel
1284 *
1285 * Do so only if it was not already scheduled and not during shutdown.
1286 * 1315 *
1287 * @param channel_ctx The context of the channel to destroy. 1316 * @param cls Context of the channel
1288 */ 1317 */
1289static void 1318static void
1290schedule_channel_destruction (struct ChannelCtx *channel_ctx) 1319destroy_channel (void *cls)
1291{ 1320{
1292 GNUNET_assert (NULL != channel_ctx); 1321 struct ChannelCtx *channel_ctx = cls;
1293 if (NULL != channel_ctx->destruction_task && 1322 struct PeerContext *peer_ctx = channel_ctx->peer_ctx;
1294 GNUNET_NO == in_shutdown)
1295 {
1296 channel_ctx->destruction_task =
1297 GNUNET_SCHEDULER_add_now (&destroy_channel,
1298 channel_ctx);
1299 }
1300}
1301 1323
1324 GNUNET_assert (channel_ctx == peer_ctx->send_channel_ctx ||
1325 channel_ctx == peer_ctx->recv_channel_ctx);
1302 1326
1303/** 1327 GNUNET_CADET_channel_destroy (channel_ctx->channel);
1304 * @brief Schedule the destruction of the given peer. 1328 remove_channel_ctx (peer_ctx->send_channel_ctx);
1305 *
1306 * Do so only if it was not already scheduled and not during shutdown.
1307 *
1308 * @param peer_ctx The context of the peer to destroy.
1309 */
1310static void
1311schedule_peer_destruction (struct PeerContext *peer_ctx)
1312{
1313 GNUNET_assert (NULL != peer_ctx);
1314 if (NULL != peer_ctx->destruction_task &&
1315 GNUNET_NO == in_shutdown)
1316 {
1317 peer_ctx->destruction_task =
1318 GNUNET_SCHEDULER_add_now (&destroy_peer,
1319 peer_ctx);
1320 }
1321} 1329}
1322 1330
1323 1331
@@ -1389,35 +1397,17 @@ Peers_remove_peer (const struct GNUNET_PeerIdentity *peer)
1389 1397
1390 /* Do we still have to wait for destruction of channels 1398 /* Do we still have to wait for destruction of channels
1391 * or issue the destruction? */ 1399 * or issue the destruction? */
1392 if (NULL != peer_ctx->send_channel_ctx && 1400 if (NULL != peer_ctx->send_channel_ctx)
1393 NULL != peer_ctx->send_channel_ctx->destruction_task)
1394 {
1395 schedule_peer_destruction (peer_ctx);
1396 return GNUNET_NO;
1397 }
1398 if (NULL != peer_ctx->recv_channel_ctx &&
1399 NULL != peer_ctx->recv_channel_ctx->destruction_task)
1400 { 1401 {
1401 schedule_peer_destruction (peer_ctx); 1402 destroy_channel (peer_ctx->send_channel_ctx);
1402 return GNUNET_NO; 1403 return GNUNET_NO;
1403 } 1404 }
1404 if (NULL != peer_ctx->recv_channel_ctx) 1405 if (NULL != peer_ctx->recv_channel_ctx)
1405 { 1406 {
1406 schedule_channel_destruction (peer_ctx->recv_channel_ctx); 1407 destroy_channel (peer_ctx->recv_channel_ctx);
1407 schedule_peer_destruction (peer_ctx);
1408 return GNUNET_NO;
1409 }
1410 if (NULL != peer_ctx->send_channel_ctx)
1411 {
1412 schedule_channel_destruction (peer_ctx->send_channel_ctx);
1413 schedule_peer_destruction (peer_ctx);
1414 return GNUNET_NO; 1408 return GNUNET_NO;
1415 } 1409 }
1416 1410 destroy_peer (peer_ctx);
1417 if (NULL != peer_ctx->destruction_task)
1418 {
1419 GNUNET_SCHEDULER_cancel (peer_ctx->destruction_task);
1420 }
1421 1411
1422 if (GNUNET_YES != 1412 if (GNUNET_YES !=
1423 GNUNET_CONTAINER_multipeermap_remove_all (peer_map, 1413 GNUNET_CONTAINER_multipeermap_remove_all (peer_map,
@@ -1432,38 +1422,6 @@ Peers_remove_peer (const struct GNUNET_PeerIdentity *peer)
1432 1422
1433 1423
1434/** 1424/**
1435 * @brief set flags on a given peer.
1436 *
1437 * @param peer the peer to set flags on
1438 * @param flags the flags
1439 */
1440void
1441Peers_set_peer_flag (const struct GNUNET_PeerIdentity *peer, enum Peers_PeerFlags flags)
1442{
1443 struct PeerContext *peer_ctx;
1444
1445 peer_ctx = get_peer_ctx (peer);
1446 set_peer_flag (peer_ctx, flags);
1447}
1448
1449
1450/**
1451 * @brief unset flags on a given peer.
1452 *
1453 * @param peer the peer to unset flags on
1454 * @param flags the flags
1455 */
1456void
1457Peers_unset_peer_flag (const struct GNUNET_PeerIdentity *peer, enum Peers_PeerFlags flags)
1458{
1459 struct PeerContext *peer_ctx;
1460
1461 peer_ctx = get_peer_ctx (peer);
1462 unset_peer_flag (peer_ctx, flags);
1463}
1464
1465
1466/**
1467 * @brief Check whether flags on a peer are set. 1425 * @brief Check whether flags on a peer are set.
1468 * 1426 *
1469 * @param peer the peer to check the flag of 1427 * @param peer the peer to check the flag of
@@ -1473,7 +1431,7 @@ Peers_unset_peer_flag (const struct GNUNET_PeerIdentity *peer, enum Peers_PeerFl
1473 * #GNUNET_YES if all given flags are set 1431 * #GNUNET_YES if all given flags are set
1474 * #GNUNET_NO otherwise 1432 * #GNUNET_NO otherwise
1475 */ 1433 */
1476int 1434static int
1477Peers_check_peer_flag (const struct GNUNET_PeerIdentity *peer, enum Peers_PeerFlags flags) 1435Peers_check_peer_flag (const struct GNUNET_PeerIdentity *peer, enum Peers_PeerFlags flags)
1478{ 1436{
1479 struct PeerContext *peer_ctx; 1437 struct PeerContext *peer_ctx;
@@ -1486,28 +1444,6 @@ Peers_check_peer_flag (const struct GNUNET_PeerIdentity *peer, enum Peers_PeerFl
1486 return check_peer_flag_set (peer_ctx, flags); 1444 return check_peer_flag_set (peer_ctx, flags);
1487} 1445}
1488 1446
1489/**
1490 * @brief Check whether we have information about the given peer.
1491 *
1492 * FIXME probably deprecated. Make this the new _online.
1493 *
1494 * @param peer peer in question
1495 *
1496 * @return #GNUNET_YES if peer is known
1497 * #GNUNET_NO if peer is not knwon
1498 */
1499int
1500Peers_check_peer_known (const struct GNUNET_PeerIdentity *peer)
1501{
1502 if (NULL != peer_map)
1503 {
1504 return GNUNET_CONTAINER_multipeermap_contains (peer_map, peer);
1505 } else
1506 {
1507 return GNUNET_NO;
1508 }
1509}
1510
1511 1447
1512/** 1448/**
1513 * @brief Check whether @a peer is actually a peer. 1449 * @brief Check whether @a peer is actually a peer.
@@ -1519,7 +1455,7 @@ Peers_check_peer_known (const struct GNUNET_PeerIdentity *peer)
1519 * @return #GNUNET_YES if peer is valid 1455 * @return #GNUNET_YES if peer is valid
1520 * #GNUNET_NO if peer is not valid 1456 * #GNUNET_NO if peer is not valid
1521 */ 1457 */
1522int 1458static int
1523Peers_check_peer_valid (const struct GNUNET_PeerIdentity *peer) 1459Peers_check_peer_valid (const struct GNUNET_PeerIdentity *peer)
1524{ 1460{
1525 return GNUNET_CONTAINER_multipeermap_contains (valid_peers, peer); 1461 return GNUNET_CONTAINER_multipeermap_contains (valid_peers, peer);
@@ -1533,7 +1469,7 @@ Peers_check_peer_valid (const struct GNUNET_PeerIdentity *peer)
1533 * 1469 *
1534 * @param peer the peer to establish channel to 1470 * @param peer the peer to establish channel to
1535 */ 1471 */
1536void 1472static void
1537Peers_indicate_sending_intention (const struct GNUNET_PeerIdentity *peer) 1473Peers_indicate_sending_intention (const struct GNUNET_PeerIdentity *peer)
1538{ 1474{
1539 GNUNET_assert (GNUNET_YES == Peers_check_peer_known (peer)); 1475 GNUNET_assert (GNUNET_YES == Peers_check_peer_known (peer));
@@ -1702,7 +1638,7 @@ Peers_destroy_sending_channel (const struct GNUNET_PeerIdentity *peer)
1702 peer_ctx = get_peer_ctx (peer); 1638 peer_ctx = get_peer_ctx (peer);
1703 if (NULL != peer_ctx->send_channel_ctx) 1639 if (NULL != peer_ctx->send_channel_ctx)
1704 { 1640 {
1705 schedule_channel_destruction (peer_ctx->send_channel_ctx); 1641 destroy_channel (peer_ctx->send_channel_ctx);
1706 (void) Peers_check_connected (peer); 1642 (void) Peers_check_connected (peer);
1707 return GNUNET_YES; 1643 return GNUNET_YES;
1708 } 1644 }
@@ -1710,26 +1646,6 @@ Peers_destroy_sending_channel (const struct GNUNET_PeerIdentity *peer)
1710} 1646}
1711 1647
1712/** 1648/**
1713 * @brief Callback for scheduler to destroy a channel
1714 *
1715 * @param cls Context of the channel
1716 */
1717static void
1718destroy_channel (void *cls)
1719{
1720 struct ChannelCtx *channel_ctx = cls;
1721 struct PeerContext *peer_ctx = channel_ctx->peer_ctx;
1722
1723 GNUNET_assert (channel_ctx == peer_ctx->send_channel_ctx ||
1724 channel_ctx == peer_ctx->recv_channel_ctx);
1725
1726 channel_ctx->destruction_task = NULL;
1727 GNUNET_CADET_channel_destroy (channel_ctx->channel);
1728 remove_channel_ctx (peer_ctx->send_channel_ctx);
1729}
1730
1731
1732/**
1733 * @brief Send a message to another peer. 1649 * @brief Send a message to another peer.
1734 * 1650 *
1735 * Keeps track about pending messages so they can be properly removed when the 1651 * Keeps track about pending messages so they can be properly removed when the
@@ -2605,7 +2521,7 @@ remove_peer (const struct GNUNET_PeerIdentity *peer)
2605 CustomPeerMap_remove_peer (push_map, peer); 2521 CustomPeerMap_remove_peer (push_map, peer);
2606 RPS_sampler_reinitialise_by_value (prot_sampler, peer); 2522 RPS_sampler_reinitialise_by_value (prot_sampler, peer);
2607 RPS_sampler_reinitialise_by_value (client_sampler, peer); 2523 RPS_sampler_reinitialise_by_value (client_sampler, peer);
2608 schedule_peer_destruction (get_peer_ctx (peer)); 2524 destroy_peer (get_peer_ctx (peer));
2609} 2525}
2610 2526
2611 2527
@@ -2675,10 +2591,6 @@ remove_channel_ctx (struct ChannelCtx *channel_ctx)
2675{ 2591{
2676 struct PeerContext *peer_ctx = channel_ctx->peer_ctx; 2592 struct PeerContext *peer_ctx = channel_ctx->peer_ctx;
2677 2593
2678 if (NULL != channel_ctx->destruction_task)
2679 {
2680 GNUNET_SCHEDULER_cancel (channel_ctx->destruction_task);
2681 }
2682 GNUNET_free (channel_ctx); 2594 GNUNET_free (channel_ctx);
2683 if (channel_ctx == peer_ctx->send_channel_ctx) 2595 if (channel_ctx == peer_ctx->send_channel_ctx)
2684 { 2596 {
@@ -4098,7 +4010,7 @@ shutdown_task (void *cls)
4098 do_round_task = NULL; 4010 do_round_task = NULL;
4099 } 4011 }
4100 4012
4101 Peers_terminate (); 4013 peers_terminate ();
4102 4014
4103 GNUNET_NSE_disconnect (nse); 4015 GNUNET_NSE_disconnect (nse);
4104 RPS_sampler_destroy (prot_sampler); 4016 RPS_sampler_destroy (prot_sampler);
diff --git a/src/rps/gnunet-service-rps_custommap.c b/src/rps/gnunet-service-rps_custommap.c
index 9e003eb39..3513ff8da 100644
--- a/src/rps/gnunet-service-rps_custommap.c
+++ b/src/rps/gnunet-service-rps_custommap.c
@@ -202,6 +202,7 @@ CustomPeerMap_remove_peer (const struct CustomPeerMap *c_peer_map,
202 p = GNUNET_CONTAINER_multihashmap32_get (c_peer_map->hash_map, *index); 202 p = GNUNET_CONTAINER_multihashmap32_get (c_peer_map->hash_map, *index);
203 GNUNET_assert (NULL != p); 203 GNUNET_assert (NULL != p);
204 GNUNET_CONTAINER_multihashmap32_remove_all (c_peer_map->hash_map, *index); 204 GNUNET_CONTAINER_multihashmap32_remove_all (c_peer_map->hash_map, *index);
205 // TODO wrong peerid?
205 GNUNET_CONTAINER_multipeermap_remove_all (c_peer_map->peer_map, peer); 206 GNUNET_CONTAINER_multipeermap_remove_all (c_peer_map->peer_map, peer);
206 if (*index != CustomPeerMap_size (c_peer_map)) 207 if (*index != CustomPeerMap_size (c_peer_map))
207 { /* fill 'gap' with peer at last index */ 208 { /* fill 'gap' with peer at last index */
diff --git a/src/rps/rps-test_util.c b/src/rps/rps-test_util.c
index 08fe96097..ed682c251 100644
--- a/src/rps/rps-test_util.c
+++ b/src/rps/rps-test_util.c
@@ -239,7 +239,7 @@ to_file_raw_unaligned (const char *file_name,
239 /* needed bits of the input byte that have not been moved */ 239 /* needed bits of the input byte that have not been moved */
240 char byte_input_leftover; 240 char byte_input_leftover;
241 unsigned num_bits_leftover; 241 unsigned num_bits_leftover;
242 unsigned num_bits_discard; 242 //unsigned num_bits_discard;
243 char byte_unaligned_new; 243 char byte_unaligned_new;
244 244
245 if ( (bits_needed - (i * 8)) <= 8) 245 if ( (bits_needed - (i * 8)) <= 8)
diff --git a/src/rps/test_rps.c b/src/rps/test_rps.c
index 08424022f..92d8c12ea 100644
--- a/src/rps/test_rps.c
+++ b/src/rps/test_rps.c
@@ -2850,7 +2850,7 @@ main (int argc, char *argv[])
2850 { 2850 {
2851 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "This is the profiler\n"); 2851 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "This is the profiler\n");
2852 cur_test_run.name = "test-rps-profiler"; 2852 cur_test_run.name = "test-rps-profiler";
2853 num_peers = 100; 2853 num_peers = 16;
2854 mal_type = 3; 2854 mal_type = 3;
2855 cur_test_run.init_peer = profiler_init_peer; 2855 cur_test_run.init_peer = profiler_init_peer;
2856 //cur_test_run.pre_test = mal_pre; 2856 //cur_test_run.pre_test = mal_pre;
diff --git a/src/rps/test_rps.conf b/src/rps/test_rps.conf
index 05bb9f444..02fbf76a4 100644
--- a/src/rps/test_rps.conf
+++ b/src/rps/test_rps.conf
@@ -1,5 +1,6 @@
1[rps] 1[rps]
2#PREFIX = valgrind --leak-check=full --show-leak-kinds=all --log-file=/tmp/rps/valgrind!gnunet-service-rps!%p 2#PREFIX = valgrind --leak-check=full --show-leak-kinds=all --log-file=/tmp/rps/valgrind!gnunet-service-rps!%p
3#PREFIX = valgrind --log-file=/tmp/rps/valgrind!gnunet-service-rps!%p
3#BINARY = gnunet-service-rps 4#BINARY = gnunet-service-rps
4UNIXPATH = $GNUNET_TMP/gnunet-service-rps.sock 5UNIXPATH = $GNUNET_TMP/gnunet-service-rps.sock
5HOME = $SERVICEHOME 6HOME = $SERVICEHOME