diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-02-08 19:53:36 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-02-08 19:53:36 +0000 |
commit | 0148b9aa02a7ce30736ba802bd6aad7d0d3a484c (patch) | |
tree | b4f9fc47bc3556e361329f512cd3a5f723540d63 /src | |
parent | 5d24ff73a2c57b94e8578d327d91e869dcae2c32 (diff) | |
download | gnunet-0148b9aa02a7ce30736ba802bd6aad7d0d3a484c.tar.gz gnunet-0148b9aa02a7ce30736ba802bd6aad7d0d3a484c.zip |
-simplify flow
Diffstat (limited to 'src')
-rw-r--r-- | src/ats/plugin_ats_proportional.c | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/src/ats/plugin_ats_proportional.c b/src/ats/plugin_ats_proportional.c index f7d68e629..8159b9d7f 100644 --- a/src/ats/plugin_ats_proportional.c +++ b/src/ats/plugin_ats_proportional.c | |||
@@ -1025,7 +1025,7 @@ update_active_address (struct GAS_PROPORTIONAL_Handle *s, | |||
1025 | 1025 | ||
1026 | 1026 | ||
1027 | /** | 1027 | /** |
1028 | * Changes the preferences for a peer in the problem | 1028 | * The preferences for a peer in the problem changed. |
1029 | * | 1029 | * |
1030 | * @param solver the solver handle | 1030 | * @param solver the solver handle |
1031 | * @param peer the peer to change the preference for | 1031 | * @param peer the peer to change the preference for |
@@ -1039,29 +1039,9 @@ GAS_proportional_address_change_preference (void *solver, | |||
1039 | double pref_rel) | 1039 | double pref_rel) |
1040 | { | 1040 | { |
1041 | struct GAS_PROPORTIONAL_Handle *s = solver; | 1041 | struct GAS_PROPORTIONAL_Handle *s = solver; |
1042 | struct ATS_Address *best_address; | ||
1043 | struct ATS_Address *active_address; | ||
1044 | struct AddressWrapper *asi; | ||
1045 | 1042 | ||
1046 | if (0 == | 1043 | distribute_bandwidth_in_network (s, |
1047 | s->env->get_connectivity (s->env->cls, | 1044 | NULL); |
1048 | peer)) | ||
1049 | return; /* Peer is not requested */ | ||
1050 | |||
1051 | /* This peer is requested, find best address */ | ||
1052 | active_address = get_active_address (s, | ||
1053 | peer); | ||
1054 | best_address = update_active_address (s, peer); | ||
1055 | |||
1056 | if ( (NULL != best_address) && | ||
1057 | (active_address == best_address) ) | ||
1058 | { | ||
1059 | asi = best_address->solver_information; | ||
1060 | GNUNET_assert (NULL != asi); | ||
1061 | |||
1062 | /* We sticked to the same address, therefore redistribute */ | ||
1063 | distribute_bandwidth_in_network (s, asi->network); | ||
1064 | } | ||
1065 | } | 1045 | } |
1066 | 1046 | ||
1067 | 1047 | ||
@@ -1083,7 +1063,7 @@ GAS_proportional_address_preference_feedback (void *solver, | |||
1083 | enum GNUNET_ATS_PreferenceKind kind, | 1063 | enum GNUNET_ATS_PreferenceKind kind, |
1084 | double score) | 1064 | double score) |
1085 | { | 1065 | { |
1086 | /* don't care about feedback */ | 1066 | /* Proportional does not care about feedback */ |
1087 | } | 1067 | } |
1088 | 1068 | ||
1089 | 1069 | ||