aboutsummaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-transport_neighbours.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2012-06-18 09:07:38 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2012-06-18 09:07:38 +0000
commit3bea1b11de57b46ba7a5b360b7c8e5dc0565edbb (patch)
tree1e9366b8ccce16e5037b8518e5e3c4f9190deeae /src/transport/gnunet-service-transport_neighbours.c
parentad8abc8cb6c635f2687bbff83ad43a9dbb821bc6 (diff)
downloadgnunet-3bea1b11de57b46ba7a5b360b7c8e5dc0565edbb.tar.gz
gnunet-3bea1b11de57b46ba7a5b360b7c8e5dc0565edbb.zip
-fix
Diffstat (limited to 'src/transport/gnunet-service-transport_neighbours.c')
-rw-r--r--src/transport/gnunet-service-transport_neighbours.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c
index 44b9338ad..78e160fa0 100644
--- a/src/transport/gnunet-service-transport_neighbours.c
+++ b/src/transport/gnunet-service-transport_neighbours.c
@@ -766,6 +766,7 @@ free_address (struct NeighbourAddress *na)
766 { 766 {
767 GST_validation_set_address_use (na->address, na->session, GNUNET_NO, __LINE__); 767 GST_validation_set_address_use (na->address, na->session, GNUNET_NO, __LINE__);
768 GNUNET_ATS_address_in_use (GST_ats, na->address, na->session, GNUNET_NO); 768 GNUNET_ATS_address_in_use (GST_ats, na->address, na->session, GNUNET_NO);
769 GNUNET_ATS_address_destroyed (GST_ats, na->address, na->session);
769 } 770 }
770 na->ats_active = GNUNET_NO; 771 na->ats_active = GNUNET_NO;
771 if (NULL != na->address) 772 if (NULL != na->address)
@@ -2681,8 +2682,10 @@ GST_neighbours_handle_connect_ack (const struct GNUNET_MessageHeader *message,
2681 * 2682 *
2682 * @param peer identity of the peer where the session died 2683 * @param peer identity of the peer where the session died
2683 * @param session session that is gone 2684 * @param session session that is gone
2685 * @param GNUNET_YES if this was a session used, GNUNET_NO if
2686 * this session was not in use
2684 */ 2687 */
2685void 2688int
2686GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer, 2689GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer,
2687 struct Session *session) 2690 struct Session *session)
2688{ 2691{
@@ -2706,7 +2709,7 @@ GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer,
2706 } 2709 }
2707 } 2710 }
2708 if (NULL == (n = lookup_neighbour (peer))) 2711 if (NULL == (n = lookup_neighbour (peer)))
2709 return; /* can't affect us */ 2712 return GNUNET_NO; /* can't affect us */
2710 if (session != n->primary_address.session) 2713 if (session != n->primary_address.session)
2711 { 2714 {
2712 if (session == n->alternative_address.session) 2715 if (session == n->alternative_address.session)
@@ -2718,7 +2721,7 @@ GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer,
2718 else 2721 else
2719 GNUNET_break (0); 2722 GNUNET_break (0);
2720 } 2723 }
2721 return; /* doesn't affect us further */ 2724 return GNUNET_NO; /* doesn't affect us further */
2722 } 2725 }
2723 2726
2724 n->expect_latency_response = GNUNET_NO; 2727 n->expect_latency_response = GNUNET_NO;
@@ -2727,11 +2730,11 @@ GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer,
2727 case S_NOT_CONNECTED: 2730 case S_NOT_CONNECTED:
2728 GNUNET_break (0); 2731 GNUNET_break (0);
2729 free_neighbour (n, GNUNET_NO); 2732 free_neighbour (n, GNUNET_NO);
2730 return; 2733 return GNUNET_YES;
2731 case S_INIT_ATS: 2734 case S_INIT_ATS:
2732 GNUNET_break (0); 2735 GNUNET_break (0);
2733 free_neighbour (n, GNUNET_NO); 2736 free_neighbour (n, GNUNET_NO);
2734 return; 2737 return GNUNET_YES;
2735 case S_INIT_BLACKLIST: 2738 case S_INIT_BLACKLIST:
2736 case S_CONNECT_SENT: 2739 case S_CONNECT_SENT:
2737 free_address (&n->primary_address); 2740 free_address (&n->primary_address);
@@ -2747,7 +2750,7 @@ GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer,
2747 /* error on inbound session; free neighbour entirely */ 2750 /* error on inbound session; free neighbour entirely */
2748 free_address (&n->primary_address); 2751 free_address (&n->primary_address);
2749 free_neighbour (n, GNUNET_NO); 2752 free_neighbour (n, GNUNET_NO);
2750 return; 2753 return GNUNET_YES;
2751 case S_CONNECTED: 2754 case S_CONNECTED:
2752 free_address (&n->primary_address); 2755 free_address (&n->primary_address);
2753 n->state = S_RECONNECT_ATS; 2756 n->state = S_RECONNECT_ATS;
@@ -2798,6 +2801,7 @@ GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer,
2798 if (GNUNET_SCHEDULER_NO_TASK != n->task) 2801 if (GNUNET_SCHEDULER_NO_TASK != n->task)
2799 GNUNET_SCHEDULER_cancel (n->task); 2802 GNUNET_SCHEDULER_cancel (n->task);
2800 n->task = GNUNET_SCHEDULER_add_now (&master_task, n); 2803 n->task = GNUNET_SCHEDULER_add_now (&master_task, n);
2804 return GNUNET_YES;
2801} 2805}
2802 2806
2803 2807