gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r10517 - gnunet/src/util


From: gnunet
Subject: [GNUnet-SVN] r10517 - gnunet/src/util
Date: Mon, 8 Mar 2010 19:39:29 +0100

Author: grothoff
Date: 2010-03-08 19:39:29 +0100 (Mon, 08 Mar 2010)
New Revision: 10517

Modified:
   gnunet/src/util/bandwidth.c
Log:
make llvm happy

Modified: gnunet/src/util/bandwidth.c
===================================================================
--- gnunet/src/util/bandwidth.c 2010-03-08 14:38:23 UTC (rev 10516)
+++ gnunet/src/util/bandwidth.c 2010-03-08 18:39:29 UTC (rev 10517)
@@ -156,20 +156,24 @@
       left_bytes = delta_avail - av->consumption_since_last_update__;
       avail_per_ms = ((unsigned long long) av->available_bytes_per_s__) / 
1000LL;
       if (avail_per_ms > 0)
-       left_time_ms = left_bytes / avail_per_ms;
-      else
-       left_time_ms = 0;
-      if (left_time_ms > ((unsigned long long) av->max_carry_s__) * 1000LL)
        {
-         /* need to limit accumulation of unused bandwidth */
-         left_time_ms = ((unsigned long long) av->max_carry_s__) * 1000LL;
-         if (left_time_ms * avail_per_ms < GNUNET_SERVER_MAX_MESSAGE_SIZE)
+         left_time_ms = left_bytes / avail_per_ms;       
+         if (left_time_ms > ((unsigned long long) av->max_carry_s__) * 1000LL)
            {
-             /* need to still allow GNUNET_SERVER_MAX_MESSAGE_SIZE 
accumulation */
-             if (left_bytes > GNUNET_SERVER_MAX_MESSAGE_SIZE)
-               left_bytes = GNUNET_SERVER_MAX_MESSAGE_SIZE;
-             left_time_ms = left_bytes / avail_per_ms;
+             /* need to limit accumulation of unused bandwidth */
+             left_time_ms = ((unsigned long long) av->max_carry_s__) * 1000LL;
+             if (left_time_ms * avail_per_ms < GNUNET_SERVER_MAX_MESSAGE_SIZE)
+               {
+                 /* need to still allow GNUNET_SERVER_MAX_MESSAGE_SIZE 
accumulation */
+                 if (left_bytes > GNUNET_SERVER_MAX_MESSAGE_SIZE)
+                   left_bytes = GNUNET_SERVER_MAX_MESSAGE_SIZE;
+                 left_time_ms = left_bytes / avail_per_ms;
+               }
            }
+         else
+           {
+             left_time_ms = 0;
+           }
        }
       av->consumption_since_last_update__ = 0;
       av->last_update__.value = now.value - left_time_ms;





reply via email to

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