diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2014-03-21 19:53:29 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2014-03-21 19:53:29 +0000 |
commit | cd8c6c39d686be3be1d18ccca41c1108784d4258 (patch) | |
tree | 49fd798558c8b4ea4ee63e2a2b11d3ca23873c80 /src/transport/gnunet-service-transport_neighbours.c | |
parent | e33dc73c8b45562f218055b9628234ac50ff350d (diff) | |
download | gnunet-cd8c6c39d686be3be1d18ccca41c1108784d4258.tar.gz gnunet-cd8c6c39d686be3be1d18ccca41c1108784d4258.zip |
remove unsued INIT_BLACKLIST state: blacklist check is done before switching
Diffstat (limited to 'src/transport/gnunet-service-transport_neighbours.c')
-rw-r--r-- | src/transport/gnunet-service-transport_neighbours.c | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c index 6fc8fb6e1..1df47a091 100644 --- a/src/transport/gnunet-service-transport_neighbours.c +++ b/src/transport/gnunet-service-transport_neighbours.c | |||
@@ -1052,7 +1052,6 @@ disconnect_neighbour (struct NeighbourMapEntry *n) | |||
1052 | { | 1052 | { |
1053 | case GNUNET_TRANSPORT_PS_NOT_CONNECTED: | 1053 | case GNUNET_TRANSPORT_PS_NOT_CONNECTED: |
1054 | case GNUNET_TRANSPORT_PS_INIT_ATS: | 1054 | case GNUNET_TRANSPORT_PS_INIT_ATS: |
1055 | case GNUNET_TRANSPORT_PS_INIT_BLACKLIST: | ||
1056 | /* other peer is completely unaware of us, no need to send DISCONNECT */ | 1055 | /* other peer is completely unaware of us, no need to send DISCONNECT */ |
1057 | free_neighbour (n, GNUNET_NO); | 1056 | free_neighbour (n, GNUNET_NO); |
1058 | return; | 1057 | return; |
@@ -2089,7 +2088,6 @@ GST_neighbours_try_connect (const struct GNUNET_PeerIdentity *target) | |||
2089 | free_neighbour (n, GNUNET_NO); | 2088 | free_neighbour (n, GNUNET_NO); |
2090 | break; | 2089 | break; |
2091 | case GNUNET_TRANSPORT_PS_INIT_ATS: | 2090 | case GNUNET_TRANSPORT_PS_INIT_ATS: |
2092 | case GNUNET_TRANSPORT_PS_INIT_BLACKLIST: | ||
2093 | case GNUNET_TRANSPORT_PS_CONNECT_SENT: | 2091 | case GNUNET_TRANSPORT_PS_CONNECT_SENT: |
2094 | case GNUNET_TRANSPORT_PS_CONNECT_RECV_BLACKLIST_INBOUND: | 2092 | case GNUNET_TRANSPORT_PS_CONNECT_RECV_BLACKLIST_INBOUND: |
2095 | case GNUNET_TRANSPORT_PS_CONNECT_RECV_ATS: | 2093 | case GNUNET_TRANSPORT_PS_CONNECT_RECV_ATS: |
@@ -2197,38 +2195,6 @@ handle_test_blacklist_cont (void *cls, | |||
2197 | /* waiting on ATS suggestion; still, pass address to ATS as a | 2195 | /* waiting on ATS suggestion; still, pass address to ATS as a |
2198 | possibility */ | 2196 | possibility */ |
2199 | break; | 2197 | break; |
2200 | case GNUNET_TRANSPORT_PS_INIT_BLACKLIST: | ||
2201 | /* check if the address the blacklist was fine with matches | ||
2202 | ATS suggestion, if so, we can move on! */ | ||
2203 | if ( (GNUNET_OK == result) && | ||
2204 | (1 == n->send_connect_ack) ) | ||
2205 | { | ||
2206 | n->send_connect_ack = 2; | ||
2207 | send_session_connect_ack_message (bcc->na.address, | ||
2208 | bcc->na.session, | ||
2209 | n->connect_ack_timestamp); | ||
2210 | } | ||
2211 | if (GNUNET_YES != address_matches (&bcc->na, &n->primary_address)) | ||
2212 | { | ||
2213 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
2214 | "Blacklist result for peer %s is for non-primary address, ignored\n", | ||
2215 | GNUNET_i2s (peer)); | ||
2216 | break; /* result for an address we currently don't care about */ | ||
2217 | } | ||
2218 | if (GNUNET_OK == result) | ||
2219 | { | ||
2220 | set_state_and_timeout (n, GNUNET_TRANSPORT_PS_CONNECT_SENT, | ||
2221 | GNUNET_TIME_relative_to_absolute (SETUP_CONNECTION_TIMEOUT)); | ||
2222 | send_session_connect (&n->primary_address); | ||
2223 | } | ||
2224 | else | ||
2225 | { | ||
2226 | free_address (&n->primary_address); | ||
2227 | GNUNET_break (0); | ||
2228 | set_state_and_timeout (n, GNUNET_TRANSPORT_PS_INIT_ATS, | ||
2229 | GNUNET_TIME_relative_to_absolute (ATS_RESPONSE_TIMEOUT)); | ||
2230 | } | ||
2231 | break; | ||
2232 | case GNUNET_TRANSPORT_PS_CONNECT_SENT: | 2198 | case GNUNET_TRANSPORT_PS_CONNECT_SENT: |
2233 | /* waiting on CONNECT_ACK, send ACK if one is pending */ | 2199 | /* waiting on CONNECT_ACK, send ACK if one is pending */ |
2234 | if ( (GNUNET_OK == result) && | 2200 | if ( (GNUNET_OK == result) && |
@@ -2495,7 +2461,6 @@ GST_neighbours_handle_connect (const struct GNUNET_MessageHeader *message, | |||
2495 | /* CONNECT message takes priority over us asking ATS for address */ | 2461 | /* CONNECT message takes priority over us asking ATS for address */ |
2496 | set_state (n, GNUNET_TRANSPORT_PS_CONNECT_RECV_BLACKLIST_INBOUND); | 2462 | set_state (n, GNUNET_TRANSPORT_PS_CONNECT_RECV_BLACKLIST_INBOUND); |
2497 | /* fallthrough */ | 2463 | /* fallthrough */ |
2498 | case GNUNET_TRANSPORT_PS_INIT_BLACKLIST: | ||
2499 | case GNUNET_TRANSPORT_PS_CONNECT_SENT: | 2464 | case GNUNET_TRANSPORT_PS_CONNECT_SENT: |
2500 | case GNUNET_TRANSPORT_PS_CONNECT_RECV_BLACKLIST_INBOUND: | 2465 | case GNUNET_TRANSPORT_PS_CONNECT_RECV_BLACKLIST_INBOUND: |
2501 | case GNUNET_TRANSPORT_PS_CONNECT_RECV_ATS: | 2466 | case GNUNET_TRANSPORT_PS_CONNECT_RECV_ATS: |
@@ -2654,14 +2619,6 @@ switch_address_bl_check_cont (void *cls, | |||
2654 | GNUNET_TIME_relative_to_absolute (SETUP_CONNECTION_TIMEOUT)); | 2619 | GNUNET_TIME_relative_to_absolute (SETUP_CONNECTION_TIMEOUT)); |
2655 | send_session_connect (&n->primary_address); | 2620 | send_session_connect (&n->primary_address); |
2656 | break; | 2621 | break; |
2657 | case GNUNET_TRANSPORT_PS_INIT_BLACKLIST: | ||
2658 | /* ATS suggests a different address, switch again */ | ||
2659 | set_primary_address (n, blc_ctx->address, blc_ctx->session, | ||
2660 | blc_ctx->bandwidth_in, blc_ctx->bandwidth_out, GNUNET_NO); | ||
2661 | set_timeout (n, GNUNET_TIME_relative_to_absolute (BLACKLIST_RESPONSE_TIMEOUT)); | ||
2662 | check_blacklist (&n->id, n->connect_ack_timestamp, | ||
2663 | blc_ctx->address, blc_ctx->session); | ||
2664 | break; | ||
2665 | case GNUNET_TRANSPORT_PS_CONNECT_SENT: | 2622 | case GNUNET_TRANSPORT_PS_CONNECT_SENT: |
2666 | /* waiting on CONNECT_ACK, send ACK if one is pending */ | 2623 | /* waiting on CONNECT_ACK, send ACK if one is pending */ |
2667 | if (1 == n->send_connect_ack) | 2624 | if (1 == n->send_connect_ack) |
@@ -3079,16 +3036,6 @@ master_task (void *cls, | |||
3079 | return; | 3036 | return; |
3080 | } | 3037 | } |
3081 | break; | 3038 | break; |
3082 | case GNUNET_TRANSPORT_PS_INIT_BLACKLIST: | ||
3083 | if (0 == delay.rel_value_us) | ||
3084 | { | ||
3085 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
3086 | "Connection to `%s' timed out waiting for BLACKLIST to approve address\n", | ||
3087 | GNUNET_i2s (&n->id)); | ||
3088 | free_neighbour (n, GNUNET_NO); | ||
3089 | return; | ||
3090 | } | ||
3091 | break; | ||
3092 | case GNUNET_TRANSPORT_PS_CONNECT_SENT: | 3039 | case GNUNET_TRANSPORT_PS_CONNECT_SENT: |
3093 | if (0 == delay.rel_value_us) | 3040 | if (0 == delay.rel_value_us) |
3094 | { | 3041 | { |
@@ -3317,7 +3264,6 @@ GST_neighbours_handle_connect_ack (const struct GNUNET_MessageHeader *message, | |||
3317 | free_neighbour (n, GNUNET_NO); | 3264 | free_neighbour (n, GNUNET_NO); |
3318 | return GNUNET_SYSERR; | 3265 | return GNUNET_SYSERR; |
3319 | case GNUNET_TRANSPORT_PS_INIT_ATS: | 3266 | case GNUNET_TRANSPORT_PS_INIT_ATS: |
3320 | case GNUNET_TRANSPORT_PS_INIT_BLACKLIST: | ||
3321 | GNUNET_STATISTICS_update (GST_stats, | 3267 | GNUNET_STATISTICS_update (GST_stats, |
3322 | gettext_noop | 3268 | gettext_noop |
3323 | ("# unexpected CONNECT_ACK messages (not ready)"), | 3269 | ("# unexpected CONNECT_ACK messages (not ready)"), |
@@ -3477,7 +3423,6 @@ GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer, | |||
3477 | GNUNET_break (0); | 3423 | GNUNET_break (0); |
3478 | free_neighbour (n, GNUNET_NO); | 3424 | free_neighbour (n, GNUNET_NO); |
3479 | return GNUNET_YES; | 3425 | return GNUNET_YES; |
3480 | case GNUNET_TRANSPORT_PS_INIT_BLACKLIST: | ||
3481 | case GNUNET_TRANSPORT_PS_CONNECT_SENT: | 3426 | case GNUNET_TRANSPORT_PS_CONNECT_SENT: |
3482 | /* The session used to send the CONNECT terminated: | 3427 | /* The session used to send the CONNECT terminated: |
3483 | * this implies a connect error*/ | 3428 | * this implies a connect error*/ |
@@ -3878,7 +3823,6 @@ GST_neighbour_get_latency (const struct GNUNET_PeerIdentity *peer) | |||
3878 | case GNUNET_TRANSPORT_PS_RECONNECT_BLACKLIST: | 3823 | case GNUNET_TRANSPORT_PS_RECONNECT_BLACKLIST: |
3879 | return n->latency; | 3824 | return n->latency; |
3880 | case GNUNET_TRANSPORT_PS_NOT_CONNECTED: | 3825 | case GNUNET_TRANSPORT_PS_NOT_CONNECTED: |
3881 | case GNUNET_TRANSPORT_PS_INIT_BLACKLIST: | ||
3882 | case GNUNET_TRANSPORT_PS_INIT_ATS: | 3826 | case GNUNET_TRANSPORT_PS_INIT_ATS: |
3883 | case GNUNET_TRANSPORT_PS_CONNECT_RECV_BLACKLIST_INBOUND: | 3827 | case GNUNET_TRANSPORT_PS_CONNECT_RECV_BLACKLIST_INBOUND: |
3884 | case GNUNET_TRANSPORT_PS_CONNECT_RECV_ATS: | 3828 | case GNUNET_TRANSPORT_PS_CONNECT_RECV_ATS: |