gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r35184 - gnunet/src/ats
Date: Sun, 8 Feb 2015 23:24:50 +0100

Author: grothoff
Date: 2015-02-08 23:24:50 +0100 (Sun, 08 Feb 2015)
New Revision: 35184

Modified:
   gnunet/src/ats/plugin_ats_proportional.c
Log:
-when selecting addresses, kick out peers with insufficient support if we are 
at the limit

Modified: gnunet/src/ats/plugin_ats_proportional.c
===================================================================
--- gnunet/src/ats/plugin_ats_proportional.c    2015-02-08 22:18:16 UTC (rev 
35183)
+++ gnunet/src/ats/plugin_ats_proportional.c    2015-02-08 22:24:50 UTC (rev 
35184)
@@ -478,30 +478,30 @@
 
   remaining_quota_in = net->total_quota_in - (net->active_addresses * min_bw);
   remaining_quota_out = net->total_quota_out - (net->active_addresses * 
min_bw);
-  LOG(GNUNET_ERROR_TYPE_DEBUG, "Remaining bandwidth : (in/out): %llu/%llu \n",
-      remaining_quota_in, remaining_quota_out);
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Proportionally distributable bandwidth (in/out): %llu/%llu\n",
+       remaining_quota_in,
+       remaining_quota_out);
   sum_relative_peer_prefences = 0.0;
 
-  /* Calculate sum of relative preference for active addresses in this network 
*/
+  /* Calculate sum of relative preference for active addresses in this
+     network */
   count_addresses = 0;
   for (aw = net->head; NULL != aw; aw = aw->next)
   {
     if (GNUNET_YES != aw->addr->active)
       continue;
-
     peer_relative_prefs = s->env->get_preferences (s->env->cls,
                                                    &aw->addr->peer);
-    relative_peer_prefence = 0.0;
-    relative_peer_prefence += 
peer_relative_prefs[GNUNET_ATS_PREFERENCE_BANDWIDTH];
-    sum_relative_peer_prefences += relative_peer_prefence;
-    count_addresses ++;
+    sum_relative_peer_prefences += 
peer_relative_prefs[GNUNET_ATS_PREFERENCE_BANDWIDTH];
+    count_addresses++;
   }
 
   if (count_addresses != net->active_addresses)
   {
     GNUNET_break (0);
     LOG (GNUNET_ERROR_TYPE_WARNING,
-         "%s: Counted %u active addresses, but network says to have %u active 
addresses\n",
+         "%s: Counted %u active addresses, expected %u active addresses\n",
          net->desc,
          count_addresses,
          net->active_addresses);
@@ -762,7 +762,7 @@
   need = (GNUNET_YES == current->active) ? 0 : 1;
   /* we save -1 slot if 'best' is active and belongs
      to the same network (as we would replace it) */
-  if ( (NULL == ctx->best) &&
+  if ( (NULL != ctx->best) &&
        (GNUNET_YES == ctx->best->active) &&
        (((struct AddressWrapper *) ctx->best->solver_information)->network ==
         asi->network) )
@@ -1064,7 +1064,7 @@
       }
     }
     update_active_address (s,
-                           aw_con->addr,
+                           aw_min->addr,
                            &aw->addr->peer);
   }
   distribute_bandwidth_in_network (s,




reply via email to

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