From fe6d808eba70afcd219dfa429af0ebe976cf8f85 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 11 May 2024 09:30:39 +0000 Subject: TSG-21194: 获取token的条件改为本地token数量小于当前报文请求的token数量 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shaping/src/shaper.cpp | 8 ++++---- 1 file 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; } -- cgit v1.2.3