diff options
Diffstat (limited to 'src/rps/gnunet-service-rps.c')
-rw-r--r-- | src/rps/gnunet-service-rps.c | 248 |
1 files changed, 80 insertions, 168 deletions
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 | ||
338 | int | 328 | /** |
339 | Peers_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 | */ | ||
338 | static int | ||
339 | Peers_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 | ||
382 | void | ||
383 | Peers_unset_peer_flag (const struct GNUNET_PeerIdentity *peer, enum Peers_PeerFlags flags); | ||
384 | 392 | ||
385 | void | 393 | /** |
386 | Peers_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 | */ | ||
399 | static void | ||
400 | Peers_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 | */ | ||
415 | static void | ||
416 | Peers_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 | */ |
398 | int | 434 | static int |
399 | Peers_check_connected (const struct GNUNET_PeerIdentity *peer) | 435 | Peers_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 | */ |
1087 | void | 1123 | static void |
1088 | Peers_initialise (char* fn_valid_peers, | 1124 | Peers_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 | */ |
1153 | int | 1189 | static int |
1154 | Peers_get_valid_peers (PeersIterator iterator, | 1190 | Peers_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 | */ |
1182 | int | 1218 | static int |
1183 | Peers_insert_peer (const struct GNUNET_PeerIdentity *peer) | 1219 | Peers_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 | ||
1193 | int | 1229 | static int |
1194 | Peers_check_peer_flag (const struct GNUNET_PeerIdentity *peer, enum Peers_PeerFlags flags); | 1230 | Peers_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 | */ |
1205 | int | 1241 | static int |
1206 | Peers_issue_peer_liveliness_check (const struct GNUNET_PeerIdentity *peer) | 1242 | Peers_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 | */ |
1235 | int | 1271 | static int |
1236 | Peers_check_removable (const struct GNUNET_PeerIdentity *peer) | 1272 | Peers_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 | ||
1255 | uint32_t * | 1291 | static uint32_t * |
1256 | Peers_get_channel_flag (const struct GNUNET_PeerIdentity *peer, | 1292 | Peers_get_channel_flag (const struct GNUNET_PeerIdentity *peer, |
1257 | enum Peers_ChannelRole role); | 1293 | enum Peers_ChannelRole role); |
1258 | 1294 | ||
1259 | int | 1295 | static int |
1260 | Peers_check_channel_flag (uint32_t *channel_flags, enum Peers_ChannelFlags flags); | 1296 | Peers_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 | ||
1278 | static void | ||
1279 | destroy_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 | */ |
1289 | static void | 1318 | static void |
1290 | schedule_channel_destruction (struct ChannelCtx *channel_ctx) | 1319 | destroy_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 | */ | ||
1310 | static void | ||
1311 | schedule_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 | */ | ||
1440 | void | ||
1441 | Peers_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 | */ | ||
1456 | void | ||
1457 | Peers_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 | */ |
1476 | int | 1434 | static int |
1477 | Peers_check_peer_flag (const struct GNUNET_PeerIdentity *peer, enum Peers_PeerFlags flags) | 1435 | Peers_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 | */ | ||
1499 | int | ||
1500 | Peers_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 | */ |
1522 | int | 1458 | static int |
1523 | Peers_check_peer_valid (const struct GNUNET_PeerIdentity *peer) | 1459 | Peers_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 | */ |
1536 | void | 1472 | static void |
1537 | Peers_indicate_sending_intention (const struct GNUNET_PeerIdentity *peer) | 1473 | Peers_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 | */ | ||
1717 | static void | ||
1718 | destroy_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); |