-trying to fix #3426
authorChristian Grothoff <christian@grothoff.org>
Wed, 11 Jun 2014 10:53:46 +0000 (10:53 +0000)
committerChristian Grothoff <christian@grothoff.org>
Wed, 11 Jun 2014 10:53:46 +0000 (10:53 +0000)
src/ats/plugin_ats_proportional.c

index 35d294145f88f181c5de6da1f1f9d895504a2d2f..901e11c1d4d844e1bd8c4c2d6129f0f837d612d5 100644 (file)
@@ -646,8 +646,9 @@ distribute_bandwidth (struct GAS_PROPORTIONAL_Handle *s,
 
   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,
+       "Remaining 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 */
@@ -667,18 +668,22 @@ distribute_bandwidth (struct GAS_PROPORTIONAL_Handle *s,
 
   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",
-        net->desc, count_addresses, net->active_addresses);
+    LOG ( (count_addresses > net->active_addresses)
+          ? GNUNET_ERROR_TYPE_WARNING
+          : GNUNET_ERROR_TYPE_INFO,
+          "%s: Counted %u active addresses, but network says to have %u active addresses \n",
+          net->desc,
+          count_addresses,
+          net->active_addresses);
     for (cur_address = net->head; NULL != cur_address; cur_address = cur_address->next)
     {
       if (GNUNET_YES != cur_address->addr->active)
         continue;
-
-      LOG (GNUNET_ERROR_TYPE_WARNING, "Active: `%s' `%s' length %u\n",
-          GNUNET_i2s (&cur_address->addr->peer), cur_address->addr->plugin,
-          cur_address->addr->addr_len);
+      LOG (GNUNET_ERROR_TYPE_WARNING,
+           "Active: `%s' `%s' length %u\n",
+           GNUNET_i2s (&cur_address->addr->peer),
+           cur_address->addr->plugin,
+           cur_address->addr->addr_len);
     }
   }