diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-02-03 16:11:15 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-02-03 16:11:15 +0000 |
commit | d9b68f30f930830b455eea95d0bc619553180136 (patch) | |
tree | ca3b084bac4c5b52a8b90f916b51d8ea9619510d /src/transport/gnunet-service-transport.c | |
parent | f0b02e3444d7653f2c1dabab449825b80e390855 (diff) | |
download | gnunet-d9b68f30f930830b455eea95d0bc619553180136.tar.gz gnunet-d9b68f30f930830b455eea95d0bc619553180136.zip |
add internal API to enable telling ATS about 'failed' suggestions
Diffstat (limited to 'src/transport/gnunet-service-transport.c')
-rw-r--r-- | src/transport/gnunet-service-transport.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c index ef05739c5..e3bbf7167 100644 --- a/src/transport/gnunet-service-transport.c +++ b/src/transport/gnunet-service-transport.c | |||
@@ -831,6 +831,14 @@ ats_request_address_change (void *cls, | |||
831 | uint32_t bw_in = ntohl (bandwidth_in.value__); | 831 | uint32_t bw_in = ntohl (bandwidth_in.value__); |
832 | uint32_t bw_out = ntohl (bandwidth_out.value__); | 832 | uint32_t bw_out = ntohl (bandwidth_out.value__); |
833 | 833 | ||
834 | if (NULL == peer) | ||
835 | { | ||
836 | /* ATS service died, all suggestions become invalid! | ||
837 | (but we'll keep using the allocations for a little | ||
838 | while, to keep going while ATS restarts) */ | ||
839 | // FIXME: do something? | ||
840 | return; | ||
841 | } | ||
834 | /* ATS tells me to disconnect from peer */ | 842 | /* ATS tells me to disconnect from peer */ |
835 | if ((0 == bw_in) && (0 == bw_out)) | 843 | if ((0 == bw_in) && (0 == bw_out)) |
836 | { | 844 | { |
@@ -847,7 +855,8 @@ ats_request_address_change (void *cls, | |||
847 | GNUNET_NO); | 855 | GNUNET_NO); |
848 | GST_neighbours_switch_to_address (address, | 856 | GST_neighbours_switch_to_address (address, |
849 | session, | 857 | session, |
850 | bandwidth_in, bandwidth_out); | 858 | bandwidth_in, |
859 | bandwidth_out); | ||
851 | } | 860 | } |
852 | 861 | ||
853 | 862 | ||