gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r16479 - gnunet/src/ats


From: gnunet
Subject: [GNUnet-SVN] r16479 - gnunet/src/ats
Date: Sat, 13 Aug 2011 11:19:29 +0200

Author: grothoff
Date: 2011-08-13 11:19:29 +0200 (Sat, 13 Aug 2011)
New Revision: 16479

Modified:
   gnunet/src/ats/ats_api.c
Log:
fix

Modified: gnunet/src/ats/ats_api.c
===================================================================
--- gnunet/src/ats/ats_api.c    2011-08-12 23:11:07 UTC (rev 16478)
+++ gnunet/src/ats/ats_api.c    2011-08-13 09:19:29 UTC (rev 16479)
@@ -81,7 +81,7 @@
 
 
 /**
- * Opaque handle to stop incremental validation address callbacks.
+ * Opaque handle to obtain address suggestions.
  */
 struct GNUNET_ATS_SuggestionContext
 {
@@ -291,11 +291,19 @@
                 const GNUNET_HashCode *key,
                 void *value)
 {
-  struct GNUNET_ATS_SuggestionContest *asc = cls;
+  struct GNUNET_ATS_SuggestionContext *asc = cls;
   struct AllocationRecord *ar = value;
-
-  // FIXME...
-  return GNUNET_YES;
+  
+  /* trivial strategy: pick first available address... */
+  asc->cb (asc->cb_cls,
+          &asc->target,
+          ar->plugin_name,
+          ar->plugin_addr,
+          ar->plugin_addr_len,
+          GNUNET_BANDWIDTH_value_init (asc->atc->total_bps / 32),
+          ar->ats, ar->ats_count);
+  asc->cb = NULL;
+  return GNUNET_NO;
 }
 
 
@@ -728,6 +736,7 @@
           ar->plugin_addr_len,
           GNUNET_BANDWIDTH_value_init (asc->atc->total_bps / 32),
           ar->ats, ar->ats_count);
+  GNUNET_ATS_suggest_address_cancel (asc);
   return GNUNET_OK;
 }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]