aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-03-08 14:33:42 +0000
committerChristian Grothoff <christian@grothoff.org>2015-03-08 14:33:42 +0000
commit023cf4e2f6a6d50c40e6717fcc67bb598f0f54a9 (patch)
tree34a324c1ff70f23245863f30bca3212571cb2efb /src/util
parent247e63b4eb4db92cc0cfb2df9ca66632cc6c90b1 (diff)
downloadgnunet-023cf4e2f6a6d50c40e6717fcc67bb598f0f54a9.tar.gz
gnunet-023cf4e2f6a6d50c40e6717fcc67bb598f0f54a9.zip
-always assume at least MIN bandwidth, even if we got no quota or a quota lower than min
Diffstat (limited to 'src/util')
-rw-r--r--src/util/bandwidth.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/util/bandwidth.c b/src/util/bandwidth.c
index 1ed87ff9b..3b9b64239 100644
--- a/src/util/bandwidth.c
+++ b/src/util/bandwidth.c
@@ -61,7 +61,26 @@ GNUNET_BANDWIDTH_value_min (struct GNUNET_BANDWIDTH_Value32NBO b1,
61{ 61{
62 return 62 return
63 GNUNET_BANDWIDTH_value_init (GNUNET_MIN 63 GNUNET_BANDWIDTH_value_init (GNUNET_MIN
64 (ntohl (b1.value__), ntohl (b2.value__))); 64 (ntohl (b1.value__),
65 ntohl (b2.value__)));
66}
67
68
69/**
70 * Compute the MAX of two bandwidth values.
71 *
72 * @param b1 first value
73 * @param b2 second value
74 * @return the min of b1 and b2
75 */
76struct GNUNET_BANDWIDTH_Value32NBO
77GNUNET_BANDWIDTH_value_max (struct GNUNET_BANDWIDTH_Value32NBO b1,
78 struct GNUNET_BANDWIDTH_Value32NBO b2)
79{
80 return
81 GNUNET_BANDWIDTH_value_init (GNUNET_MAX
82 (ntohl (b1.value__),
83 ntohl (b2.value__)));
65} 84}
66 85
67 86