mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2026-02-26 16:57:08 +00:00
fix: strategyFn index out of range if proxies changed (#2330)
This commit is contained in:
@@ -194,7 +194,7 @@ func strategyStickySessions(url string) strategyFn {
|
||||
key := utils.MapHash(getKeyWithSrcAndDst(metadata))
|
||||
length := len(proxies)
|
||||
idx, has := lruCache.Get(key)
|
||||
if !has {
|
||||
if !has || idx >= length {
|
||||
idx = int(jumpHash(key+uint64(time.Now().UnixNano()), int32(length)))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user