aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/transport/gnunet-service-transport.c2
-rw-r--r--src/transport/gnunet-service-transport_neighbours.c22
-rw-r--r--src/transport/transport_api.c2
3 files changed, 13 insertions, 13 deletions
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c
index 4a1216a6f..4a22b45e8 100644
--- a/src/transport/gnunet-service-transport.c
+++ b/src/transport/gnunet-service-transport.c
@@ -205,7 +205,7 @@ process_payload (const struct GNUNET_PeerIdentity *peer,
205 return ret; 205 return ret;
206 } 206 }
207 207
208 GST_ats_add_address ((struct GNUNET_HELLO_Address *) address, session); 208 GST_ats_add_address (address, session);
209 209
210 if (GNUNET_YES != do_forward) 210 if (GNUNET_YES != do_forward)
211 return ret; 211 return ret;
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c
index 321bf0fe5..bef75ca6f 100644
--- a/src/transport/gnunet-service-transport_neighbours.c
+++ b/src/transport/gnunet-service-transport_neighbours.c
@@ -1949,9 +1949,9 @@ handle_test_blacklist_cont (void *cls,
1949 break; /* result for an address we currently don't care about */ 1949 break; /* result for an address we currently don't care about */
1950 if (GNUNET_OK == result) 1950 if (GNUNET_OK == result)
1951 { 1951 {
1952 n->state = S_RECONNECT_SENT;
1952 send_session_connect (&n->primary_address); 1953 send_session_connect (&n->primary_address);
1953 n->timeout = GNUNET_TIME_relative_to_absolute (FAST_RECONNECT_TIMEOUT); 1954 n->timeout = GNUNET_TIME_relative_to_absolute (FAST_RECONNECT_TIMEOUT);
1954 n->state = S_RECONNECT_SENT;
1955 } 1955 }
1956 else 1956 else
1957 { 1957 {
@@ -1980,8 +1980,8 @@ handle_test_blacklist_cont (void *cls,
1980 } 1980 }
1981 else 1981 else
1982 { 1982 {
1983 free_address (&n->alternative_address);
1984 n->state = S_CONNECTED; 1983 n->state = S_CONNECTED;
1984 free_address (&n->alternative_address);
1985 } 1985 }
1986 break; 1986 break;
1987 case S_CONNECTED_SWITCHING_CONNECT_SENT: 1987 case S_CONNECTED_SWITCHING_CONNECT_SENT:
@@ -2318,17 +2318,17 @@ GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer,
2318 } 2318 }
2319 /* ATS asks us to switch a life connection; see if we can get 2319 /* ATS asks us to switch a life connection; see if we can get
2320 a CONNECT_ACK on it before we actually do this! */ 2320 a CONNECT_ACK on it before we actually do this! */
2321 n->state = S_CONNECTED_SWITCHING_BLACKLIST;
2321 set_address (&n->alternative_address, 2322 set_address (&n->alternative_address,
2322 address, session, bandwidth_in, bandwidth_out, GNUNET_NO); 2323 address, session, bandwidth_in, bandwidth_out, GNUNET_NO);
2323 n->state = S_CONNECTED_SWITCHING_BLACKLIST;
2324 check_blacklist (&n->id, 2324 check_blacklist (&n->id,
2325 GNUNET_TIME_absolute_get (), 2325 GNUNET_TIME_absolute_get (),
2326 address, session); 2326 address, session);
2327 break; 2327 break;
2328 case S_RECONNECT_ATS: 2328 case S_RECONNECT_ATS:
2329 n->state = S_RECONNECT_BLACKLIST;
2329 set_address (&n->primary_address, 2330 set_address (&n->primary_address,
2330 address, session, bandwidth_in, bandwidth_out, GNUNET_NO); 2331 address, session, bandwidth_in, bandwidth_out, GNUNET_NO);
2331 n->state = S_RECONNECT_BLACKLIST;
2332 n->timeout = GNUNET_TIME_relative_to_absolute (BLACKLIST_RESPONSE_TIMEOUT); 2332 n->timeout = GNUNET_TIME_relative_to_absolute (BLACKLIST_RESPONSE_TIMEOUT);
2333 check_blacklist (&n->id, 2333 check_blacklist (&n->id,
2334 n->connect_ack_timestamp, 2334 n->connect_ack_timestamp,
@@ -2347,9 +2347,9 @@ GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer,
2347 case S_RECONNECT_SENT: 2347 case S_RECONNECT_SENT:
2348 /* ATS asks us to switch while we were trying to reconnect; switch to new 2348 /* ATS asks us to switch while we were trying to reconnect; switch to new
2349 address and check blacklist again */ 2349 address and check blacklist again */
2350 n->state = S_RECONNECT_BLACKLIST;
2350 set_address (&n->primary_address, 2351 set_address (&n->primary_address,
2351 address, session, bandwidth_in, bandwidth_out, GNUNET_NO); 2352 address, session, bandwidth_in, bandwidth_out, GNUNET_NO);
2352 n->state = S_RECONNECT_BLACKLIST;
2353 n->timeout = GNUNET_TIME_relative_to_absolute (BLACKLIST_RESPONSE_TIMEOUT); 2353 n->timeout = GNUNET_TIME_relative_to_absolute (BLACKLIST_RESPONSE_TIMEOUT);
2354 check_blacklist (&n->id, 2354 check_blacklist (&n->id,
2355 n->connect_ack_timestamp, 2355 n->connect_ack_timestamp,
@@ -2359,8 +2359,8 @@ GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer,
2359 if (n->primary_address.session == session) 2359 if (n->primary_address.session == session)
2360 { 2360 {
2361 /* ATS switches back to still-active session */ 2361 /* ATS switches back to still-active session */
2362 free_address (&n->alternative_address);
2363 n->state = S_CONNECTED; 2362 n->state = S_CONNECTED;
2363 free_address (&n->alternative_address);
2364 break; 2364 break;
2365 } 2365 }
2366 /* ATS asks us to switch a life connection, update blacklist check */ 2366 /* ATS asks us to switch a life connection, update blacklist check */
@@ -2379,9 +2379,9 @@ GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer,
2379 break; 2379 break;
2380 } 2380 }
2381 /* ATS asks us to switch a life connection, update blacklist check */ 2381 /* ATS asks us to switch a life connection, update blacklist check */
2382 n->state = S_CONNECTED_SWITCHING_BLACKLIST;
2382 set_address (&n->alternative_address, 2383 set_address (&n->alternative_address,
2383 address, session, bandwidth_in, bandwidth_out, GNUNET_NO); 2384 address, session, bandwidth_in, bandwidth_out, GNUNET_NO);
2384 n->state = S_CONNECTED_SWITCHING_BLACKLIST;
2385 check_blacklist (&n->id, 2385 check_blacklist (&n->id,
2386 GNUNET_TIME_absolute_get (), 2386 GNUNET_TIME_absolute_get (),
2387 address, session); 2387 address, session);
@@ -2964,12 +2964,12 @@ GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer,
2964 { 2964 {
2965 if (session == n->alternative_address.session) 2965 if (session == n->alternative_address.session)
2966 { 2966 {
2967 free_address (&n->alternative_address);
2968 if ( (S_CONNECTED_SWITCHING_BLACKLIST == n->state) || 2967 if ( (S_CONNECTED_SWITCHING_BLACKLIST == n->state) ||
2969 (S_CONNECTED_SWITCHING_CONNECT_SENT == n->state) ) 2968 (S_CONNECTED_SWITCHING_CONNECT_SENT == n->state) )
2970 n->state = S_CONNECTED; 2969 n->state = S_CONNECTED;
2971 else 2970 else
2972 GNUNET_break (0); 2971 GNUNET_break (0);
2972 free_address (&n->alternative_address);
2973 } 2973 }
2974 return GNUNET_NO; /* doesn't affect us further */ 2974 return GNUNET_NO; /* doesn't affect us further */
2975 } 2975 }
@@ -3002,8 +3002,8 @@ GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer,
3002 free_neighbour (n, GNUNET_NO); 3002 free_neighbour (n, GNUNET_NO);
3003 return GNUNET_YES; 3003 return GNUNET_YES;
3004 case S_CONNECTED: 3004 case S_CONNECTED:
3005 free_address (&n->primary_address);
3006 n->state = S_RECONNECT_ATS; 3005 n->state = S_RECONNECT_ATS;
3006 free_address (&n->primary_address);
3007 n->timeout = GNUNET_TIME_relative_to_absolute (ATS_RESPONSE_TIMEOUT); 3007 n->timeout = GNUNET_TIME_relative_to_absolute (ATS_RESPONSE_TIMEOUT);
3008 /* FIXME: is this ATS call needed? */ 3008 /* FIXME: is this ATS call needed? */
3009 n->suggest_handle = GNUNET_ATS_suggest_address (GST_ats, &n->id); 3009 n->suggest_handle = GNUNET_ATS_suggest_address (GST_ats, &n->id);
@@ -3022,20 +3022,20 @@ GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer,
3022 case S_CONNECTED_SWITCHING_BLACKLIST: 3022 case S_CONNECTED_SWITCHING_BLACKLIST:
3023 /* primary went down while we were checking secondary against 3023 /* primary went down while we were checking secondary against
3024 blacklist, adopt secondary as primary */ 3024 blacklist, adopt secondary as primary */
3025 n->state = S_RECONNECT_BLACKLIST;
3025 free_address (&n->primary_address); 3026 free_address (&n->primary_address);
3026 n->primary_address = n->alternative_address; 3027 n->primary_address = n->alternative_address;
3027 memset (&n->alternative_address, 0, sizeof (struct NeighbourAddress)); 3028 memset (&n->alternative_address, 0, sizeof (struct NeighbourAddress));
3028 n->timeout = GNUNET_TIME_relative_to_absolute (FAST_RECONNECT_TIMEOUT); 3029 n->timeout = GNUNET_TIME_relative_to_absolute (FAST_RECONNECT_TIMEOUT);
3029 n->state = S_RECONNECT_BLACKLIST;
3030 break; 3030 break;
3031 case S_CONNECTED_SWITCHING_CONNECT_SENT: 3031 case S_CONNECTED_SWITCHING_CONNECT_SENT:
3032 /* primary went down while we were waiting for CONNECT_ACK on secondary; 3032 /* primary went down while we were waiting for CONNECT_ACK on secondary;
3033 secondary as primary */ 3033 secondary as primary */
3034 n->state = S_RECONNECT_SENT;
3034 free_address (&n->primary_address); 3035 free_address (&n->primary_address);
3035 n->primary_address = n->alternative_address; 3036 n->primary_address = n->alternative_address;
3036 memset (&n->alternative_address, 0, sizeof (struct NeighbourAddress)); 3037 memset (&n->alternative_address, 0, sizeof (struct NeighbourAddress));
3037 n->timeout = GNUNET_TIME_relative_to_absolute (FAST_RECONNECT_TIMEOUT); 3038 n->timeout = GNUNET_TIME_relative_to_absolute (FAST_RECONNECT_TIMEOUT);
3038 n->state = S_RECONNECT_SENT;
3039 break; 3039 break;
3040 case S_DISCONNECT: 3040 case S_DISCONNECT:
3041 free_address (&n->primary_address); 3041 free_address (&n->primary_address);
diff --git a/src/transport/transport_api.c b/src/transport/transport_api.c
index 327827113..8d921acdc 100644
--- a/src/transport/transport_api.c
+++ b/src/transport/transport_api.c
@@ -1518,7 +1518,7 @@ GNUNET_TRANSPORT_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
1518/** 1518/**
1519 * Disconnect from the transport service. 1519 * Disconnect from the transport service.
1520 * 1520 *
1521 * @param handle handle to the service as returned from GNUNET_TRANSPORT_connect 1521 * @param handle handle to the service as returned from #GNUNET_TRANSPORT_connect()
1522 */ 1522 */
1523void 1523void
1524GNUNET_TRANSPORT_disconnect (struct GNUNET_TRANSPORT_Handle *handle) 1524GNUNET_TRANSPORT_disconnect (struct GNUNET_TRANSPORT_Handle *handle)