diff options
Diffstat (limited to 'src/transport/gnunet-service-transport_neighbours.c')
-rw-r--r-- | src/transport/gnunet-service-transport_neighbours.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c index 286e009d3..b11add24c 100644 --- a/src/transport/gnunet-service-transport_neighbours.c +++ b/src/transport/gnunet-service-transport_neighbours.c | |||
@@ -1131,7 +1131,7 @@ disconnect_neighbour (struct NeighbourMapEntry *n) | |||
1131 | send_disconnect (n); | 1131 | send_disconnect (n); |
1132 | set_state (n, GNUNET_TRANSPORT_PS_DISCONNECT); | 1132 | set_state (n, GNUNET_TRANSPORT_PS_DISCONNECT); |
1133 | break; | 1133 | break; |
1134 | case GNUNET_TRANSPORT_PS_CONNECTED_SWITCHING_SYN_SENT: | 1134 | case GNUNET_TRANSPORT_PS_SWITCH_SYN_SENT: |
1135 | case GNUNET_TRANSPORT_PS_CONNECTED: | 1135 | case GNUNET_TRANSPORT_PS_CONNECTED: |
1136 | case GNUNET_TRANSPORT_PS_RECONNECT_SENT: | 1136 | case GNUNET_TRANSPORT_PS_RECONNECT_SENT: |
1137 | /* we are currently connected, need to send disconnect and do | 1137 | /* we are currently connected, need to send disconnect and do |
@@ -1325,7 +1325,7 @@ send_keepalive (struct NeighbourMapEntry *n) | |||
1325 | uint32_t nonce; | 1325 | uint32_t nonce; |
1326 | 1326 | ||
1327 | GNUNET_assert ((GNUNET_TRANSPORT_PS_CONNECTED == n->state) || | 1327 | GNUNET_assert ((GNUNET_TRANSPORT_PS_CONNECTED == n->state) || |
1328 | (GNUNET_TRANSPORT_PS_CONNECTED_SWITCHING_SYN_SENT)); | 1328 | (GNUNET_TRANSPORT_PS_SWITCH_SYN_SENT)); |
1329 | if (GNUNET_TIME_absolute_get_remaining (n->keep_alive_time).rel_value_us > 0) | 1329 | if (GNUNET_TIME_absolute_get_remaining (n->keep_alive_time).rel_value_us > 0) |
1330 | return; /* no keepalive needed at this time */ | 1330 | return; /* no keepalive needed at this time */ |
1331 | 1331 | ||
@@ -1671,7 +1671,7 @@ send_session_connect_cont (void *cls, | |||
1671 | 1671 | ||
1672 | if ( (GNUNET_TRANSPORT_PS_SYN_SENT != n->state) && | 1672 | if ( (GNUNET_TRANSPORT_PS_SYN_SENT != n->state) && |
1673 | (GNUNET_TRANSPORT_PS_RECONNECT_SENT != n->state) && | 1673 | (GNUNET_TRANSPORT_PS_RECONNECT_SENT != n->state) && |
1674 | (GNUNET_TRANSPORT_PS_CONNECTED_SWITCHING_SYN_SENT != n->state)) | 1674 | (GNUNET_TRANSPORT_PS_SWITCH_SYN_SENT != n->state)) |
1675 | { | 1675 | { |
1676 | /* SYN continuation was called after neighbor changed state, | 1676 | /* SYN continuation was called after neighbor changed state, |
1677 | * for example due to a time out for the state or the session | 1677 | * for example due to a time out for the state or the session |
@@ -1706,7 +1706,7 @@ send_session_connect_cont (void *cls, | |||
1706 | set_state_and_timeout (n, GNUNET_TRANSPORT_PS_RECONNECT_ATS, | 1706 | set_state_and_timeout (n, GNUNET_TRANSPORT_PS_RECONNECT_ATS, |
1707 | GNUNET_TIME_relative_to_absolute (ATS_RESPONSE_TIMEOUT)); | 1707 | GNUNET_TIME_relative_to_absolute (ATS_RESPONSE_TIMEOUT)); |
1708 | break; | 1708 | break; |
1709 | case GNUNET_TRANSPORT_PS_CONNECTED_SWITCHING_SYN_SENT: | 1709 | case GNUNET_TRANSPORT_PS_SWITCH_SYN_SENT: |
1710 | /* Remove address and request and go back to primary address */ | 1710 | /* Remove address and request and go back to primary address */ |
1711 | GNUNET_STATISTICS_update (GST_stats, gettext_noop | 1711 | GNUNET_STATISTICS_update (GST_stats, gettext_noop |
1712 | ("# Failed attempts to switch addresses (failed to send SYN CONT)"), 1, GNUNET_NO); | 1712 | ("# Failed attempts to switch addresses (failed to send SYN CONT)"), 1, GNUNET_NO); |
@@ -1795,7 +1795,7 @@ send_syn (struct NeighbourAddress *na) | |||
1795 | set_state_and_timeout (n, GNUNET_TRANSPORT_PS_RECONNECT_ATS, | 1795 | set_state_and_timeout (n, GNUNET_TRANSPORT_PS_RECONNECT_ATS, |
1796 | GNUNET_TIME_relative_to_absolute (ATS_RESPONSE_TIMEOUT)); | 1796 | GNUNET_TIME_relative_to_absolute (ATS_RESPONSE_TIMEOUT)); |
1797 | break; | 1797 | break; |
1798 | case GNUNET_TRANSPORT_PS_CONNECTED_SWITCHING_SYN_SENT: | 1798 | case GNUNET_TRANSPORT_PS_SWITCH_SYN_SENT: |
1799 | GNUNET_STATISTICS_update (GST_stats, gettext_noop | 1799 | GNUNET_STATISTICS_update (GST_stats, gettext_noop |
1800 | ("# Failed attempts to switch addresses (failed to send SYN)"), 1, GNUNET_NO); | 1800 | ("# Failed attempts to switch addresses (failed to send SYN)"), 1, GNUNET_NO); |
1801 | /* Remove address and request and additional one */ | 1801 | /* Remove address and request and additional one */ |
@@ -2255,7 +2255,7 @@ GST_neighbours_try_connect (const struct GNUNET_PeerIdentity *target) | |||
2255 | case GNUNET_TRANSPORT_PS_CONNECTED: | 2255 | case GNUNET_TRANSPORT_PS_CONNECTED: |
2256 | case GNUNET_TRANSPORT_PS_RECONNECT_ATS: | 2256 | case GNUNET_TRANSPORT_PS_RECONNECT_ATS: |
2257 | case GNUNET_TRANSPORT_PS_RECONNECT_SENT: | 2257 | case GNUNET_TRANSPORT_PS_RECONNECT_SENT: |
2258 | case GNUNET_TRANSPORT_PS_CONNECTED_SWITCHING_SYN_SENT: | 2258 | case GNUNET_TRANSPORT_PS_SWITCH_SYN_SENT: |
2259 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 2259 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
2260 | "Ignoring request to try to connect, already connected to `%s'!\n", | 2260 | "Ignoring request to try to connect, already connected to `%s'!\n", |
2261 | GNUNET_i2s (target)); | 2261 | GNUNET_i2s (target)); |
@@ -2385,7 +2385,7 @@ GST_neighbours_handle_session_syn (const struct GNUNET_MessageHeader *message, | |||
2385 | send_connect_ack_message (n->primary_address.address, | 2385 | send_connect_ack_message (n->primary_address.address, |
2386 | n->primary_address.session, n->connect_ack_timestamp); | 2386 | n->primary_address.session, n->connect_ack_timestamp); |
2387 | break; | 2387 | break; |
2388 | case GNUNET_TRANSPORT_PS_CONNECTED_SWITCHING_SYN_SENT: | 2388 | case GNUNET_TRANSPORT_PS_SWITCH_SYN_SENT: |
2389 | /* We are already connected and can thus send the ACK immediately; | 2389 | /* We are already connected and can thus send the ACK immediately; |
2390 | still, it can never hurt to have an alternative address, so also | 2390 | still, it can never hurt to have an alternative address, so also |
2391 | tell ATS about it */ | 2391 | tell ATS about it */ |
@@ -2612,7 +2612,7 @@ switch_address_bl_check_cont (void *cls, | |||
2612 | a SYN_ACK on it before we actually do this! */ | 2612 | a SYN_ACK on it before we actually do this! */ |
2613 | set_alternative_address (n, blc_ctx->address, blc_ctx->session, | 2613 | set_alternative_address (n, blc_ctx->address, blc_ctx->session, |
2614 | blc_ctx->bandwidth_in, blc_ctx->bandwidth_out); | 2614 | blc_ctx->bandwidth_in, blc_ctx->bandwidth_out); |
2615 | set_state_and_timeout (n, GNUNET_TRANSPORT_PS_CONNECTED_SWITCHING_SYN_SENT, | 2615 | set_state_and_timeout (n, GNUNET_TRANSPORT_PS_SWITCH_SYN_SENT, |
2616 | GNUNET_TIME_relative_to_absolute (SETUP_CONNECTION_TIMEOUT)); | 2616 | GNUNET_TIME_relative_to_absolute (SETUP_CONNECTION_TIMEOUT)); |
2617 | GNUNET_STATISTICS_update (GST_stats, gettext_noop | 2617 | GNUNET_STATISTICS_update (GST_stats, gettext_noop |
2618 | ("# Attempts to switch addresses"), 1, GNUNET_NO); | 2618 | ("# Attempts to switch addresses"), 1, GNUNET_NO); |
@@ -2641,7 +2641,7 @@ switch_address_bl_check_cont (void *cls, | |||
2641 | GNUNET_TIME_relative_to_absolute (FAST_RECONNECT_TIMEOUT)); | 2641 | GNUNET_TIME_relative_to_absolute (FAST_RECONNECT_TIMEOUT)); |
2642 | send_syn (&n->primary_address); | 2642 | send_syn (&n->primary_address); |
2643 | break; | 2643 | break; |
2644 | case GNUNET_TRANSPORT_PS_CONNECTED_SWITCHING_SYN_SENT: | 2644 | case GNUNET_TRANSPORT_PS_SWITCH_SYN_SENT: |
2645 | if ( (0 == GNUNET_HELLO_address_cmp(n->primary_address.address, | 2645 | if ( (0 == GNUNET_HELLO_address_cmp(n->primary_address.address, |
2646 | blc_ctx->address) && n->primary_address.session == blc_ctx->session) ) | 2646 | blc_ctx->address) && n->primary_address.session == blc_ctx->session) ) |
2647 | { | 2647 | { |
@@ -2653,7 +2653,7 @@ switch_address_bl_check_cont (void *cls, | |||
2653 | /* ATS asks us to switch a life connection, send */ | 2653 | /* ATS asks us to switch a life connection, send */ |
2654 | set_alternative_address (n, blc_ctx->address, blc_ctx->session, | 2654 | set_alternative_address (n, blc_ctx->address, blc_ctx->session, |
2655 | blc_ctx->bandwidth_in, blc_ctx->bandwidth_out); | 2655 | blc_ctx->bandwidth_in, blc_ctx->bandwidth_out); |
2656 | set_state_and_timeout (n, GNUNET_TRANSPORT_PS_CONNECTED_SWITCHING_SYN_SENT, | 2656 | set_state_and_timeout (n, GNUNET_TRANSPORT_PS_SWITCH_SYN_SENT, |
2657 | GNUNET_TIME_relative_to_absolute (SETUP_CONNECTION_TIMEOUT)); | 2657 | GNUNET_TIME_relative_to_absolute (SETUP_CONNECTION_TIMEOUT)); |
2658 | send_syn (&n->alternative_address); | 2658 | send_syn (&n->alternative_address); |
2659 | break; | 2659 | break; |
@@ -3029,7 +3029,7 @@ master_task (void *cls, | |||
3029 | return; | 3029 | return; |
3030 | } | 3030 | } |
3031 | break; | 3031 | break; |
3032 | case GNUNET_TRANSPORT_PS_CONNECTED_SWITCHING_SYN_SENT: | 3032 | case GNUNET_TRANSPORT_PS_SWITCH_SYN_SENT: |
3033 | if (0 == delay.rel_value_us) | 3033 | if (0 == delay.rel_value_us) |
3034 | { | 3034 | { |
3035 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 3035 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
@@ -3060,7 +3060,7 @@ master_task (void *cls, | |||
3060 | GNUNET_break (0); | 3060 | GNUNET_break (0); |
3061 | break; | 3061 | break; |
3062 | } | 3062 | } |
3063 | if ( (GNUNET_TRANSPORT_PS_CONNECTED_SWITCHING_SYN_SENT == n->state) || | 3063 | if ( (GNUNET_TRANSPORT_PS_SWITCH_SYN_SENT == n->state) || |
3064 | (GNUNET_TRANSPORT_PS_CONNECTED == n->state) ) | 3064 | (GNUNET_TRANSPORT_PS_CONNECTED == n->state) ) |
3065 | { | 3065 | { |
3066 | /* if we are *now* in one of the two states, we're sending | 3066 | /* if we are *now* in one of the two states, we're sending |
@@ -3209,7 +3209,7 @@ GST_neighbours_handle_session_syn_ack (const struct GNUNET_MessageHeader *messag | |||
3209 | GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT)); | 3209 | GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT)); |
3210 | send_session_ack_message (n); | 3210 | send_session_ack_message (n); |
3211 | break; | 3211 | break; |
3212 | case GNUNET_TRANSPORT_PS_CONNECTED_SWITCHING_SYN_SENT: | 3212 | case GNUNET_TRANSPORT_PS_SWITCH_SYN_SENT: |
3213 | /* new address worked; adopt it and go back to connected! */ | 3213 | /* new address worked; adopt it and go back to connected! */ |
3214 | set_state_and_timeout (n, GNUNET_TRANSPORT_PS_CONNECTED, | 3214 | set_state_and_timeout (n, GNUNET_TRANSPORT_PS_CONNECTED, |
3215 | GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT)); | 3215 | GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT)); |
@@ -3288,7 +3288,7 @@ GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer, | |||
3288 | /* Free alternative address */ | 3288 | /* Free alternative address */ |
3289 | if (session == n->alternative_address.session) | 3289 | if (session == n->alternative_address.session) |
3290 | { | 3290 | { |
3291 | if ( (GNUNET_TRANSPORT_PS_CONNECTED_SWITCHING_SYN_SENT == n->state) ) | 3291 | if ( (GNUNET_TRANSPORT_PS_SWITCH_SYN_SENT == n->state) ) |
3292 | set_state (n, GNUNET_TRANSPORT_PS_CONNECTED); | 3292 | set_state (n, GNUNET_TRANSPORT_PS_CONNECTED); |
3293 | free_address (&n->alternative_address); | 3293 | free_address (&n->alternative_address); |
3294 | } | 3294 | } |
@@ -3353,7 +3353,7 @@ GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer, | |||
3353 | set_state_and_timeout (n, GNUNET_TRANSPORT_PS_RECONNECT_ATS, | 3353 | set_state_and_timeout (n, GNUNET_TRANSPORT_PS_RECONNECT_ATS, |
3354 | GNUNET_TIME_relative_to_absolute (ATS_RESPONSE_TIMEOUT)); | 3354 | GNUNET_TIME_relative_to_absolute (ATS_RESPONSE_TIMEOUT)); |
3355 | break; | 3355 | break; |
3356 | case GNUNET_TRANSPORT_PS_CONNECTED_SWITCHING_SYN_SENT: | 3356 | case GNUNET_TRANSPORT_PS_SWITCH_SYN_SENT: |
3357 | /* primary went down while we were waiting for SYN_ACK on secondary; | 3357 | /* primary went down while we were waiting for SYN_ACK on secondary; |
3358 | secondary as primary */ | 3358 | secondary as primary */ |
3359 | 3359 | ||
@@ -3485,7 +3485,7 @@ GST_neighbours_handle_session_ack (const struct GNUNET_MessageHeader *message, | |||
3485 | GNUNET_NO); | 3485 | GNUNET_NO); |
3486 | } | 3486 | } |
3487 | 3487 | ||
3488 | if (GNUNET_TRANSPORT_PS_CONNECTED_SWITCHING_SYN_SENT == n->state) | 3488 | if (GNUNET_TRANSPORT_PS_SWITCH_SYN_SENT == n->state) |
3489 | { | 3489 | { |
3490 | /* We tried to switch addresses while being connect. We explicitly wait | 3490 | /* We tried to switch addresses while being connect. We explicitly wait |
3491 | * for a SYN_ACK before going to GNUNET_TRANSPORT_PS_CONNECTED, | 3491 | * for a SYN_ACK before going to GNUNET_TRANSPORT_PS_CONNECTED, |
@@ -3764,7 +3764,7 @@ GST_neighbour_get_latency (const struct GNUNET_PeerIdentity *peer) | |||
3764 | switch (n->state) | 3764 | switch (n->state) |
3765 | { | 3765 | { |
3766 | case GNUNET_TRANSPORT_PS_CONNECTED: | 3766 | case GNUNET_TRANSPORT_PS_CONNECTED: |
3767 | case GNUNET_TRANSPORT_PS_CONNECTED_SWITCHING_SYN_SENT: | 3767 | case GNUNET_TRANSPORT_PS_SWITCH_SYN_SENT: |
3768 | case GNUNET_TRANSPORT_PS_RECONNECT_SENT: | 3768 | case GNUNET_TRANSPORT_PS_RECONNECT_SENT: |
3769 | case GNUNET_TRANSPORT_PS_RECONNECT_ATS: | 3769 | case GNUNET_TRANSPORT_PS_RECONNECT_ATS: |
3770 | return n->latency; | 3770 | return n->latency; |