diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-10-17 10:04:07 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-10-17 10:04:07 +0000 |
commit | 31ab92e674ff6892e4ee6b0736164094f14c3a0a (patch) | |
tree | 9b4cd56db06ade5d77c45a811ebd215e34422a36 /src/ats | |
parent | a41c27367cfbe9fde370a6590da4926f622ea213 (diff) | |
download | gnunet-31ab92e674ff6892e4ee6b0736164094f14c3a0a.tar.gz gnunet-31ab92e674ff6892e4ee6b0736164094f14c3a0a.zip |
fix
Diffstat (limited to 'src/ats')
-rw-r--r-- | src/ats/gnunet-service-ats_addresses.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ats/gnunet-service-ats_addresses.c b/src/ats/gnunet-service-ats_addresses.c index af4669dbd..b3e838f39 100644 --- a/src/ats/gnunet-service-ats_addresses.c +++ b/src/ats/gnunet-service-ats_addresses.c | |||
@@ -100,6 +100,7 @@ update_bw_it (void *cls, | |||
100 | 100 | ||
101 | if (GNUNET_YES != aa->active) | 101 | if (GNUNET_YES != aa->active) |
102 | return GNUNET_OK; | 102 | return GNUNET_OK; |
103 | GNUNET_assert (active_addr_count > 0); | ||
103 | aa->assigned_bw_in.value__ = htonl (total_quota_in / active_addr_count); | 104 | aa->assigned_bw_in.value__ = htonl (total_quota_in / active_addr_count); |
104 | aa->assigned_bw_out.value__ = htonl (total_quota_out / active_addr_count); | 105 | aa->assigned_bw_out.value__ = htonl (total_quota_out / active_addr_count); |
105 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 106 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -158,6 +159,7 @@ destroy_address (struct ATS_Address *addr) | |||
158 | if (GNUNET_YES == addr->active) | 159 | if (GNUNET_YES == addr->active) |
159 | { | 160 | { |
160 | active_addr_count--; | 161 | active_addr_count--; |
162 | addr->active = GNUNET_NO; | ||
161 | ret = GNUNET_YES; | 163 | ret = GNUNET_YES; |
162 | } | 164 | } |
163 | GNUNET_free_non_null (addr->ats); | 165 | GNUNET_free_non_null (addr->ats); |
@@ -292,6 +294,9 @@ GAS_addresses_update (const struct GNUNET_PeerIdentity *peer, | |||
292 | old->atsp_cost_wlan = ntohl (atsi[i].value); | 294 | old->atsp_cost_wlan = ntohl (atsi[i].value); |
293 | break; | 295 | break; |
294 | default: | 296 | default: |
297 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
298 | "Received unsupported ATS type %u\n", | ||
299 | ntohl (atsi[i].type)); | ||
295 | GNUNET_break (0); | 300 | GNUNET_break (0); |
296 | break; | 301 | break; |
297 | } | 302 | } |
@@ -329,6 +334,7 @@ GAS_addresses_destroy (const struct GNUNET_PeerIdentity *peer, | |||
329 | res->session_id = 0; | 334 | res->session_id = 0; |
330 | if (GNUNET_YES == res->active) | 335 | if (GNUNET_YES == res->active) |
331 | { | 336 | { |
337 | res->active = GNUNET_NO; | ||
332 | active_addr_count--; | 338 | active_addr_count--; |
333 | recalculate_assigned_bw (); | 339 | recalculate_assigned_bw (); |
334 | } | 340 | } |