diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-02-08 19:43:00 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-02-08 19:43:00 +0000 |
commit | eb35d815d2008d7744d0c5bf87e769a014d175dd (patch) | |
tree | e4839cbd4671a225492bd150f23202f091611d39 /src/ats/plugin_ats_proportional.c | |
parent | 95a96fd973027546558ed634be8f6ffbc4f97214 (diff) | |
download | gnunet-eb35d815d2008d7744d0c5bf87e769a014d175dd.tar.gz gnunet-eb35d815d2008d7744d0c5bf87e769a014d175dd.zip |
-simplify logic
Diffstat (limited to 'src/ats/plugin_ats_proportional.c')
-rw-r--r-- | src/ats/plugin_ats_proportional.c | 31 |
1 files changed, 3 insertions, 28 deletions
diff --git a/src/ats/plugin_ats_proportional.c b/src/ats/plugin_ats_proportional.c index 0883dceb2..ad026c619 100644 --- a/src/ats/plugin_ats_proportional.c +++ b/src/ats/plugin_ats_proportional.c | |||
@@ -1212,35 +1212,10 @@ GAS_proportional_address_property_changed (void *solver, | |||
1212 | double rel_value) | 1212 | double rel_value) |
1213 | { | 1213 | { |
1214 | struct GAS_PROPORTIONAL_Handle *s = solver; | 1214 | struct GAS_PROPORTIONAL_Handle *s = solver; |
1215 | struct AddressWrapper *asi; | 1215 | struct AddressWrapper *asi = address->solver_information; |
1216 | struct ATS_Address *best_address; | ||
1217 | struct ATS_Address *active_address; | ||
1218 | |||
1219 | asi = address->solver_information; | ||
1220 | LOG (GNUNET_ERROR_TYPE_INFO, | ||
1221 | "Property `%s' for peer `%s' address %p changed to %.2f\n", | ||
1222 | GNUNET_ATS_print_property_type (type), | ||
1223 | GNUNET_i2s (&address->peer), | ||
1224 | address, | ||
1225 | rel_value); | ||
1226 | |||
1227 | if (0 == | ||
1228 | s->env->get_connectivity (s->env->cls, | ||
1229 | &address->peer)) | ||
1230 | return; /* Peer is not requested */ | ||
1231 | 1216 | ||
1232 | /* This peer is requested, find active and best address */ | 1217 | distribute_bandwidth_in_network (s, |
1233 | active_address = get_active_address (s, | 1218 | asi->network); |
1234 | &address->peer); | ||
1235 | best_address = update_active_address (s, | ||
1236 | &address->peer); | ||
1237 | if (active_address == best_address) | ||
1238 | { | ||
1239 | /* We stuck to the same address, therefore redistribute | ||
1240 | (NOTE: because otherwise update_active_address() already | ||
1241 | calls distribute_bandwidth_in_network() )*/ | ||
1242 | distribute_bandwidth_in_network (s, asi->network); | ||
1243 | } | ||
1244 | } | 1219 | } |
1245 | 1220 | ||
1246 | 1221 | ||