From d9b68f30f930830b455eea95d0bc619553180136 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 3 Feb 2015 16:11:15 +0000 Subject: add internal API to enable telling ATS about 'failed' suggestions --- src/transport/gnunet-service-transport.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/transport/gnunet-service-transport.c') 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, uint32_t bw_in = ntohl (bandwidth_in.value__); uint32_t bw_out = ntohl (bandwidth_out.value__); + if (NULL == peer) + { + /* ATS service died, all suggestions become invalid! + (but we'll keep using the allocations for a little + while, to keep going while ATS restarts) */ + // FIXME: do something? + return; + } /* ATS tells me to disconnect from peer */ if ((0 == bw_in) && (0 == bw_out)) { @@ -847,7 +855,8 @@ ats_request_address_change (void *cls, GNUNET_NO); GST_neighbours_switch_to_address (address, session, - bandwidth_in, bandwidth_out); + bandwidth_in, + bandwidth_out); } -- cgit v1.2.3