diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-11-09 12:42:42 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-11-09 12:42:42 +0000 |
commit | 6bb56f0470a01cf58ad8a9ad4a37fbd9814f089a (patch) | |
tree | 7407276a7e0e74e0fec7ff3747a27daa37d62250 /src/transport | |
parent | 20f8436676445ff9ba5976333eea814e413c3043 (diff) | |
download | gnunet-6bb56f0470a01cf58ad8a9ad4a37fbd9814f089a.tar.gz gnunet-6bb56f0470a01cf58ad8a9ad4a37fbd9814f089a.zip |
clean up, asserts, FIXME
Diffstat (limited to 'src/transport')
-rw-r--r-- | src/transport/gnunet-service-transport_neighbours.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c index 2e3523a8e..62fc441a1 100644 --- a/src/transport/gnunet-service-transport_neighbours.c +++ b/src/transport/gnunet-service-transport_neighbours.c | |||
@@ -1247,6 +1247,7 @@ GST_neighbours_switch_to_address_3way (const struct GNUNET_PeerIdentity *peer, | |||
1247 | if (n->state == S_CONNECTED) | 1247 | if (n->state == S_CONNECTED) |
1248 | { | 1248 | { |
1249 | /* mark old address as no longer used */ | 1249 | /* mark old address as no longer used */ |
1250 | GNUNET_assert (NULL != n->address); | ||
1250 | GST_validation_set_address_use (&n->id, | 1251 | GST_validation_set_address_use (&n->id, |
1251 | n->address, | 1252 | n->address, |
1252 | n->session, | 1253 | n->session, |
@@ -1472,9 +1473,9 @@ GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer, | |||
1472 | { | 1473 | { |
1473 | struct NeighbourMapEntry *n; | 1474 | struct NeighbourMapEntry *n; |
1474 | 1475 | ||
1475 | // This can happen during shutdown | ||
1476 | if (neighbours == NULL) | 1476 | if (neighbours == NULL) |
1477 | { | 1477 | { |
1478 | /* This can happen during shutdown */ | ||
1478 | return; | 1479 | return; |
1479 | } | 1480 | } |
1480 | 1481 | ||
@@ -1488,17 +1489,22 @@ GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer, | |||
1488 | return; | 1489 | return; |
1489 | if (session != n->session) | 1490 | if (session != n->session) |
1490 | return; /* doesn't affect us */ | 1491 | return; /* doesn't affect us */ |
1491 | 1492 | if (n->state == S_CONNECTED) | |
1493 | GST_validation_set_address_use (&n->id, | ||
1494 | n->address, | ||
1495 | n->session, | ||
1496 | GNUNET_NO); | ||
1492 | n->session = NULL; | 1497 | n->session = NULL; |
1493 | if (NULL != n->address) | 1498 | if (NULL != n->address) |
1494 | { | 1499 | { |
1495 | GNUNET_HELLO_address_free (n->address); | 1500 | GNUNET_HELLO_address_free (n->address); |
1496 | n->address = NULL; | 1501 | n->address = NULL; |
1497 | } | 1502 | } |
1498 | 1503 | ||
1499 | /* not connected anymore anyway, shouldn't matter */ | 1504 | /* not connected anymore anyway, shouldn't matter */ |
1500 | if ((S_CONNECTED != n->state) && (!is_connecting (n))) | 1505 | if ((S_CONNECTED != n->state) && (!is_connecting (n))) |
1501 | return; | 1506 | return; |
1507 | // FIXME: n->state = S_FAST_RECONNECT; | ||
1502 | 1508 | ||
1503 | /* We are connected, so ask ATS to switch addresses */ | 1509 | /* We are connected, so ask ATS to switch addresses */ |
1504 | GNUNET_SCHEDULER_cancel (n->timeout_task); | 1510 | GNUNET_SCHEDULER_cancel (n->timeout_task); |
@@ -1509,7 +1515,7 @@ GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer, | |||
1509 | if (n->ats_suggest != GNUNET_SCHEDULER_NO_TASK) | 1515 | if (n->ats_suggest != GNUNET_SCHEDULER_NO_TASK) |
1510 | GNUNET_SCHEDULER_cancel (n->ats_suggest); | 1516 | GNUNET_SCHEDULER_cancel (n->ats_suggest); |
1511 | n->ats_suggest = | 1517 | n->ats_suggest = |
1512 | GNUNET_SCHEDULER_add_delayed (ATS_RESPONSE_TIMEOUT, ats_suggest_cancel, | 1518 | GNUNET_SCHEDULER_add_delayed (ATS_RESPONSE_TIMEOUT, &ats_suggest_cancel, |
1513 | n); | 1519 | n); |
1514 | GNUNET_ATS_suggest_address (GST_ats, peer); | 1520 | GNUNET_ATS_suggest_address (GST_ats, peer); |
1515 | } | 1521 | } |