summaryrefslogtreecommitdiff
path: root/shaping/src/shaper.cpp
diff options
context:
space:
mode:
authorroot <[email protected]>2024-01-09 08:20:21 +0000
committerroot <[email protected]>2024-01-09 08:20:21 +0000
commit5f4d71b683d3d460bb0785a9426a4f12c81d99c9 (patch)
treead90f13e0866045d6a7afe5aa45f5ecad71b1c9d /shaping/src/shaper.cpp
parent7c599b8c88ecc009651062eddbff0b07909b8928 (diff)
TSG-18176:对于一个session,当同一个profile多次作为primary profile出现时,按规则匹配顺序,只执行匹配的第一条rule,使用被执行的rule配置的fair-factor。
当同一个profile作为borrow多次出现时,暂时忽略此情况不处理
Diffstat (limited to 'shaping/src/shaper.cpp')
-rw-r--r--shaping/src/shaper.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/shaping/src/shaper.cpp b/shaping/src/shaper.cpp
index 5a53232..6ea2afe 100644
--- a/shaping/src/shaper.cpp
+++ b/shaping/src/shaper.cpp
@@ -729,8 +729,11 @@ static int shaper_token_consume(struct shaping_thread_ctx *ctx, struct shaping_f
}
struct shaping_rule_info *rule = &sf->matched_rule_infos[sf->anchor];
+ if (rule->has_dup_profile) {
+ return SHAPER_TOKEN_GET_PASS;//dup profile, don't need to get token and forward packet
+ }
+
time_t curr_time = time(NULL);
-
if (curr_time - sf->check_rule_time >= ctx->conf.check_rule_enable_interval_sec) {
sf->check_rule_time = curr_time;
if (shaper_rule_is_enabled(ctx, rule->id) != 1) {