diff options
| author | 刘畅 <[email protected]> | 2024-05-11 09:38:40 +0000 |
|---|---|---|
| committer | 刘畅 <[email protected]> | 2024-05-11 09:38:40 +0000 |
| commit | c30360433bfc042afa35d3f2fcee554de1bfd80c (patch) | |
| tree | c3c5d34e5989ca28151d98d29c982d58ceb49fa2 | |
| parent | 628fa62399aeab2b82ee588084a974471b64b260 (diff) | |
| parent | fe6d808eba70afcd219dfa429af0ebe976cf8f85 (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
| -rw-r--r-- | shaping/src/shaper.cpp | 8 |
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; } |
