diff options
| -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; } |
