mirror of
https://github.com/Rayzggz/server_torii.git
synced 2025-06-19 21:51:20 +08:00
feat: HTTP FLOOD Speed Limit
This commit is contained in:
@ -39,3 +39,13 @@ func ParseRate(s string) (int64, int64, error) {
|
||||
}
|
||||
return int64(limit), int64(seconds), nil
|
||||
}
|
||||
|
||||
func FindMaxRateTime(rateList map[int64]int64) int64 {
|
||||
maxTimeWindow := int64(0)
|
||||
for window := range rateList {
|
||||
if window > maxTimeWindow {
|
||||
maxTimeWindow = window
|
||||
}
|
||||
}
|
||||
return maxTimeWindow
|
||||
}
|
||||
|
Reference in New Issue
Block a user