diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-08-13 09:19:29 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-08-13 09:19:29 +0000 |
commit | c7a9d7499cfd6b72e79f4b18cd2c126a89849a91 (patch) | |
tree | 32b6d4276bf712bdbc2dfc0d0a586576563afb9a /src/ats/ats_api.c | |
parent | 1af0bbf7eed53db863d413a1862ac1ded3f29ffc (diff) | |
download | gnunet-c7a9d7499cfd6b72e79f4b18cd2c126a89849a91.tar.gz gnunet-c7a9d7499cfd6b72e79f4b18cd2c126a89849a91.zip |
fix
Diffstat (limited to 'src/ats/ats_api.c')
-rw-r--r-- | src/ats/ats_api.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/ats/ats_api.c b/src/ats/ats_api.c index 1fcdd8262..547c70378 100644 --- a/src/ats/ats_api.c +++ b/src/ats/ats_api.c | |||
@@ -81,7 +81,7 @@ struct AllocationRecord | |||
81 | 81 | ||
82 | 82 | ||
83 | /** | 83 | /** |
84 | * Opaque handle to stop incremental validation address callbacks. | 84 | * Opaque handle to obtain address suggestions. |
85 | */ | 85 | */ |
86 | struct GNUNET_ATS_SuggestionContext | 86 | struct GNUNET_ATS_SuggestionContext |
87 | { | 87 | { |
@@ -291,11 +291,19 @@ suggest_address (void *cls, | |||
291 | const GNUNET_HashCode *key, | 291 | const GNUNET_HashCode *key, |
292 | void *value) | 292 | void *value) |
293 | { | 293 | { |
294 | struct GNUNET_ATS_SuggestionContest *asc = cls; | 294 | struct GNUNET_ATS_SuggestionContext *asc = cls; |
295 | struct AllocationRecord *ar = value; | 295 | struct AllocationRecord *ar = value; |
296 | 296 | ||
297 | // FIXME... | 297 | /* trivial strategy: pick first available address... */ |
298 | return GNUNET_YES; | 298 | asc->cb (asc->cb_cls, |
299 | &asc->target, | ||
300 | ar->plugin_name, | ||
301 | ar->plugin_addr, | ||
302 | ar->plugin_addr_len, | ||
303 | GNUNET_BANDWIDTH_value_init (asc->atc->total_bps / 32), | ||
304 | ar->ats, ar->ats_count); | ||
305 | asc->cb = NULL; | ||
306 | return GNUNET_NO; | ||
299 | } | 307 | } |
300 | 308 | ||
301 | 309 | ||
@@ -728,6 +736,7 @@ notify_valid (void *cls, | |||
728 | ar->plugin_addr_len, | 736 | ar->plugin_addr_len, |
729 | GNUNET_BANDWIDTH_value_init (asc->atc->total_bps / 32), | 737 | GNUNET_BANDWIDTH_value_init (asc->atc->total_bps / 32), |
730 | ar->ats, ar->ats_count); | 738 | ar->ats, ar->ats_count); |
739 | GNUNET_ATS_suggest_address_cancel (asc); | ||
731 | return GNUNET_OK; | 740 | return GNUNET_OK; |
732 | } | 741 | } |
733 | 742 | ||