summaryrefslogtreecommitdiff
path: root/src/ats/plugin_ats_proportional.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-02-08 18:13:10 +0000
committerChristian Grothoff <christian@grothoff.org>2015-02-08 18:13:10 +0000
commited8beb3bda5f3b1d2bf31f57f077bf90e40af812 (patch)
tree4ee276dfc49030a79cd7a8c5b26ab08a6aaffde2 /src/ats/plugin_ats_proportional.c
parente1669fabbcb9f21c509e03811fe2d8b5b568b15c (diff)
downloadgnunet-ed8beb3bda5f3b1d2bf31f57f077bf90e40af812.tar.gz
gnunet-ed8beb3bda5f3b1d2bf31f57f077bf90e40af812.zip
changing s_get API to return void instead of address, have plugin use existing mechanism to signal address activation
Diffstat (limited to 'src/ats/plugin_ats_proportional.c')
-rw-r--r--src/ats/plugin_ats_proportional.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/src/ats/plugin_ats_proportional.c b/src/ats/plugin_ats_proportional.c
index 7f0fcd042..70c3d4771 100644
--- a/src/ats/plugin_ats_proportional.c
+++ b/src/ats/plugin_ats_proportional.c
@@ -929,26 +929,15 @@ update_active_address (struct GAS_PROPORTIONAL_Handle *s,
929 struct AddressWrapper *asi; 929 struct AddressWrapper *asi;
930 struct Network *net; 930 struct Network *net;
931 931
932 LOG (GNUNET_ERROR_TYPE_INFO,
933 "Updating active address for peer `%s'\n",
934 GNUNET_i2s (peer));
935
936 /* Find active address */
937 current_address = get_active_address (s, 932 current_address = get_active_address (s,
938 peer); 933 peer);
939
940 LOG (GNUNET_ERROR_TYPE_INFO,
941 "Peer `%s' has active address %p\n",
942 GNUNET_i2s (peer),
943 current_address);
944
945 /* Find best address */
946 best_address = get_best_address (s, 934 best_address = get_best_address (s,
947 s->env->addresses, 935 s->env->addresses,
948 peer); 936 peer);
949 LOG (GNUNET_ERROR_TYPE_INFO, 937 LOG (GNUNET_ERROR_TYPE_INFO,
950 "Peer `%s' has best address %p\n", 938 "Peer `%s' has active address %p and best address %p\n",
951 GNUNET_i2s (peer), 939 GNUNET_i2s (peer),
940 current_address,
952 best_address); 941 best_address);
953 942
954 if (NULL != current_address) 943 if (NULL != current_address)
@@ -1106,19 +1095,21 @@ GAS_proportional_address_preference_feedback (void *solver,
1106 * 1095 *
1107 * @param solver the solver handle 1096 * @param solver the solver handle
1108 * @param peer the identity of the peer 1097 * @param peer the identity of the peer
1109 * @return best address
1110 */ 1098 */
1111static const struct ATS_Address * 1099static void
1112GAS_proportional_get_preferred_address (void *solver, 1100GAS_proportional_get_preferred_address (void *solver,
1113 const struct GNUNET_PeerIdentity *peer) 1101 const struct GNUNET_PeerIdentity *peer)
1114{ 1102{
1115 struct GAS_PROPORTIONAL_Handle *s = solver; 1103 struct GAS_PROPORTIONAL_Handle *s = solver;
1116 const struct ATS_Address *best_address; 1104 struct ATS_Address *best_address;
1117 1105
1118 best_address = update_active_address (s, peer); 1106 best_address = update_active_address (s, peer);
1107 if (NULL == best_address)
1108 return;
1119 if (s->bulk_lock > 0) 1109 if (s->bulk_lock > 0)
1120 return NULL; 1110 return;
1121 return best_address; 1111 s->env->bandwidth_changed_cb (s->env->cls,
1112 best_address);
1122} 1113}
1123 1114
1124 1115