BUG修复前不对UDP链接进行限速

This commit is contained in:
wyx2685
2024-08-14 01:35:30 +09:00
parent 9e8f87740e
commit 07d49293d8
3 changed files with 5 additions and 6 deletions

View File

@@ -183,7 +183,7 @@ func (l *Limiter) CheckLimit(taguuid string, ip string, isTcp bool, noSSUDP bool
limit := int64(determineSpeedLimit(nodeLimit, userLimit)) * 1000000 / 8 // If you need the Speed limit
if limit > 0 {
Bucket = ratelimit.NewBucketWithQuantum(time.Second, 5*limit, limit) // Byte/s
Bucket = ratelimit.NewBucketWithQuantum(time.Second, limit, limit) // Byte/s
if v, ok := l.SpeedLimiter.LoadOrStore(taguuid, Bucket); ok {
return v.(*ratelimit.Bucket), false
} else {