summaryrefslogtreecommitdiff
path: root/shaping/src/shaper.cpp
diff options
context:
space:
mode:
author刘畅 <[email protected]>2024-05-11 09:38:40 +0000
committer刘畅 <[email protected]>2024-05-11 09:38:40 +0000
commitc30360433bfc042afa35d3f2fcee554de1bfd80c (patch)
treec3c5d34e5989ca28151d98d29c982d58ceb49fa2 /shaping/src/shaper.cpp
parent628fa62399aeab2b82ee588084a974471b64b260 (diff)
parentfe6d808eba70afcd219dfa429af0ebe976cf8f85 (diff)
Merge branch 'fixbug_request_token_when_deposit_not_enough' into 'rel'v3.1.35
获取token的条件改为本地token数量小于当前报文请求的token数量 See merge request tango/shaping-engine!94
Diffstat (limited to 'shaping/src/shaper.cpp')
-rw-r--r--shaping/src/shaper.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/shaping/src/shaper.cpp b/shaping/src/shaper.cpp
index 60e7acd..16c9475 100644
--- a/shaping/src/shaper.cpp
+++ b/shaping/src/shaper.cpp
@@ -587,15 +587,15 @@ static int shaper_deposit_token_get(struct shaping_profile_info *profile, int re
return 0;
}
+ if (*deposit_token < req_token_bits) {
+ *need_get_token = 1;
+ }
+
if (force || *deposit_token >= req_token_bits) {
*deposit_token -= req_token_bits;
ret = 0;
}
- if (*deposit_token <= 0) {
- *need_get_token = 1;
- }
-
return ret;
}