diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-03-08 14:33:42 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-03-08 14:33:42 +0000 |
commit | 023cf4e2f6a6d50c40e6717fcc67bb598f0f54a9 (patch) | |
tree | 34a324c1ff70f23245863f30bca3212571cb2efb /src/include/gnunet_bandwidth_lib.h | |
parent | 247e63b4eb4db92cc0cfb2df9ca66632cc6c90b1 (diff) | |
download | gnunet-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/include/gnunet_bandwidth_lib.h')
-rw-r--r-- | src/include/gnunet_bandwidth_lib.h | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/include/gnunet_bandwidth_lib.h b/src/include/gnunet_bandwidth_lib.h index 82d8a1862..1190210ba 100644 --- a/src/include/gnunet_bandwidth_lib.h +++ b/src/include/gnunet_bandwidth_lib.h | |||
@@ -195,17 +195,29 @@ GNUNET_BANDWIDTH_value_min (struct GNUNET_BANDWIDTH_Value32NBO b1, | |||
195 | 195 | ||
196 | 196 | ||
197 | /** | 197 | /** |
198 | * Compute the MAX of two bandwidth values. | ||
199 | * | ||
200 | * @param b1 first value | ||
201 | * @param b2 second value | ||
202 | * @return the min of b1 and b2 | ||
203 | */ | ||
204 | struct GNUNET_BANDWIDTH_Value32NBO | ||
205 | GNUNET_BANDWIDTH_value_max (struct GNUNET_BANDWIDTH_Value32NBO b1, | ||
206 | struct GNUNET_BANDWIDTH_Value32NBO b2); | ||
207 | |||
208 | |||
209 | /** | ||
198 | * Initialize bandwidth tracker. Note that in addition to the | 210 | * Initialize bandwidth tracker. Note that in addition to the |
199 | * 'max_carry_s' limit, we also always allow at least | 211 | * 'max_carry_s' limit, we also always allow at least |
200 | * GNUNET_SERVER_MAX_MESSAGE_SIZE to accumulate. So if the | 212 | * #GNUNET_SERVER_MAX_MESSAGE_SIZE to accumulate. So if the |
201 | * bytes-per-second limit is so small that within 'max_carry_s' not | 213 | * bytes-per-second limit is so small that within 'max_carry_s' not |
202 | * even GNUNET_SERVER_MAX_MESSAGE_SIZE is allowed to accumulate, it is | 214 | * even #GNUNET_SERVER_MAX_MESSAGE_SIZE is allowed to accumulate, it is |
203 | * ignored and replaced by GNUNET_SERVER_MAX_MESSAGE_SIZE (which is in | 215 | * ignored and replaced by #GNUNET_SERVER_MAX_MESSAGE_SIZE (which is in |
204 | * bytes). | 216 | * bytes). |
205 | * | 217 | * |
206 | * @param av tracker to initialize | 218 | * @param av tracker to initialize |
207 | * @param update_cb callback to notify a client about the tracker being updated | 219 | * @param update_cb callback to notify a client about the tracker being updated |
208 | * @param update_cb_cls cls for the callback | 220 | * @param update_cb_cls cls for the @a update_cb callback |
209 | * @param bytes_per_second_limit initial limit to assume | 221 | * @param bytes_per_second_limit initial limit to assume |
210 | * @param max_carry_s maximum number of seconds unused bandwidth | 222 | * @param max_carry_s maximum number of seconds unused bandwidth |
211 | * may accumulate before it expires | 223 | * may accumulate before it expires |