From cd8c6c39d686be3be1d18ccca41c1108784d4258 Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Fri, 21 Mar 2014 19:53:29 +0000 Subject: [PATCH] remove unsued INIT_BLACKLIST state: blacklist check is done before switching --- .../gnunet-service-transport_neighbours.c | 56 ------------------- src/transport/transport_api_monitoring.c | 3 - 2 files changed, 59 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) { case GNUNET_TRANSPORT_PS_NOT_CONNECTED: case GNUNET_TRANSPORT_PS_INIT_ATS: - case GNUNET_TRANSPORT_PS_INIT_BLACKLIST: /* other peer is completely unaware of us, no need to send DISCONNECT */ free_neighbour (n, GNUNET_NO); return; @@ -2089,7 +2088,6 @@ GST_neighbours_try_connect (const struct GNUNET_PeerIdentity *target) free_neighbour (n, GNUNET_NO); break; case GNUNET_TRANSPORT_PS_INIT_ATS: - case GNUNET_TRANSPORT_PS_INIT_BLACKLIST: case GNUNET_TRANSPORT_PS_CONNECT_SENT: case GNUNET_TRANSPORT_PS_CONNECT_RECV_BLACKLIST_INBOUND: case GNUNET_TRANSPORT_PS_CONNECT_RECV_ATS: @@ -2197,38 +2195,6 @@ handle_test_blacklist_cont (void *cls, /* waiting on ATS suggestion; still, pass address to ATS as a possibility */ break; - case GNUNET_TRANSPORT_PS_INIT_BLACKLIST: - /* check if the address the blacklist was fine with matches - ATS suggestion, if so, we can move on! */ - if ( (GNUNET_OK == result) && - (1 == n->send_connect_ack) ) - { - n->send_connect_ack = 2; - send_session_connect_ack_message (bcc->na.address, - bcc->na.session, - n->connect_ack_timestamp); - } - if (GNUNET_YES != address_matches (&bcc->na, &n->primary_address)) - { - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "Blacklist result for peer %s is for non-primary address, ignored\n", - GNUNET_i2s (peer)); - break; /* result for an address we currently don't care about */ - } - if (GNUNET_OK == result) - { - set_state_and_timeout (n, GNUNET_TRANSPORT_PS_CONNECT_SENT, - GNUNET_TIME_relative_to_absolute (SETUP_CONNECTION_TIMEOUT)); - send_session_connect (&n->primary_address); - } - else - { - free_address (&n->primary_address); - GNUNET_break (0); - set_state_and_timeout (n, GNUNET_TRANSPORT_PS_INIT_ATS, - GNUNET_TIME_relative_to_absolute (ATS_RESPONSE_TIMEOUT)); - } - break; case GNUNET_TRANSPORT_PS_CONNECT_SENT: /* waiting on CONNECT_ACK, send ACK if one is pending */ if ( (GNUNET_OK == result) && @@ -2495,7 +2461,6 @@ GST_neighbours_handle_connect (const struct GNUNET_MessageHeader *message, /* CONNECT message takes priority over us asking ATS for address */ set_state (n, GNUNET_TRANSPORT_PS_CONNECT_RECV_BLACKLIST_INBOUND); /* fallthrough */ - case GNUNET_TRANSPORT_PS_INIT_BLACKLIST: case GNUNET_TRANSPORT_PS_CONNECT_SENT: case GNUNET_TRANSPORT_PS_CONNECT_RECV_BLACKLIST_INBOUND: case GNUNET_TRANSPORT_PS_CONNECT_RECV_ATS: @@ -2654,14 +2619,6 @@ switch_address_bl_check_cont (void *cls, GNUNET_TIME_relative_to_absolute (SETUP_CONNECTION_TIMEOUT)); send_session_connect (&n->primary_address); break; - case GNUNET_TRANSPORT_PS_INIT_BLACKLIST: - /* ATS suggests a different address, switch again */ - set_primary_address (n, blc_ctx->address, blc_ctx->session, - blc_ctx->bandwidth_in, blc_ctx->bandwidth_out, GNUNET_NO); - set_timeout (n, GNUNET_TIME_relative_to_absolute (BLACKLIST_RESPONSE_TIMEOUT)); - check_blacklist (&n->id, n->connect_ack_timestamp, - blc_ctx->address, blc_ctx->session); - break; case GNUNET_TRANSPORT_PS_CONNECT_SENT: /* waiting on CONNECT_ACK, send ACK if one is pending */ if (1 == n->send_connect_ack) @@ -3079,16 +3036,6 @@ master_task (void *cls, return; } break; - case GNUNET_TRANSPORT_PS_INIT_BLACKLIST: - if (0 == delay.rel_value_us) - { - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "Connection to `%s' timed out waiting for BLACKLIST to approve address\n", - GNUNET_i2s (&n->id)); - free_neighbour (n, GNUNET_NO); - return; - } - break; case GNUNET_TRANSPORT_PS_CONNECT_SENT: if (0 == delay.rel_value_us) { @@ -3317,7 +3264,6 @@ GST_neighbours_handle_connect_ack (const struct GNUNET_MessageHeader *message, free_neighbour (n, GNUNET_NO); return GNUNET_SYSERR; case GNUNET_TRANSPORT_PS_INIT_ATS: - case GNUNET_TRANSPORT_PS_INIT_BLACKLIST: GNUNET_STATISTICS_update (GST_stats, gettext_noop ("# unexpected CONNECT_ACK messages (not ready)"), @@ -3477,7 +3423,6 @@ GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer, GNUNET_break (0); free_neighbour (n, GNUNET_NO); return GNUNET_YES; - case GNUNET_TRANSPORT_PS_INIT_BLACKLIST: case GNUNET_TRANSPORT_PS_CONNECT_SENT: /* The session used to send the CONNECT terminated: * this implies a connect error*/ @@ -3878,7 +3823,6 @@ GST_neighbour_get_latency (const struct GNUNET_PeerIdentity *peer) case GNUNET_TRANSPORT_PS_RECONNECT_BLACKLIST: return n->latency; case GNUNET_TRANSPORT_PS_NOT_CONNECTED: - case GNUNET_TRANSPORT_PS_INIT_BLACKLIST: case GNUNET_TRANSPORT_PS_INIT_ATS: case GNUNET_TRANSPORT_PS_CONNECT_RECV_BLACKLIST_INBOUND: case GNUNET_TRANSPORT_PS_CONNECT_RECV_ATS: diff --git a/src/transport/transport_api_monitoring.c b/src/transport/transport_api_monitoring.c index 810bca0cb..6f5856006 100644 --- a/src/transport/transport_api_monitoring.c +++ b/src/transport/transport_api_monitoring.c @@ -153,7 +153,6 @@ GNUNET_TRANSPORT_is_connected (enum GNUNET_TRANSPORT_PeerState state) { case GNUNET_TRANSPORT_PS_NOT_CONNECTED: case GNUNET_TRANSPORT_PS_INIT_ATS: - case GNUNET_TRANSPORT_PS_INIT_BLACKLIST: case GNUNET_TRANSPORT_PS_CONNECT_SENT: case GNUNET_TRANSPORT_PS_CONNECT_RECV_BLACKLIST_INBOUND: case GNUNET_TRANSPORT_PS_CONNECT_RECV_ATS: @@ -195,8 +194,6 @@ GNUNET_TRANSPORT_ps2s (enum GNUNET_TRANSPORT_PeerState state) return "S_NOT_CONNECTED"; case GNUNET_TRANSPORT_PS_INIT_ATS: return "S_INIT_ATS"; - case GNUNET_TRANSPORT_PS_INIT_BLACKLIST: - return "S_INIT_BLACKLIST"; case GNUNET_TRANSPORT_PS_CONNECT_SENT: return "S_CONNECT_SENT"; case GNUNET_TRANSPORT_PS_CONNECT_RECV_BLACKLIST_INBOUND: -- 2.25.1