mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2026-12-02 07:26:47 +00:00
fix: potential race condition in c.idleSession.Len() in idleCleanupExpTime() for anytls (#3225)
This commit is contained in:
1 parent
fbb674227d
commit
5019cc090e
1 file changed
+2
-1
@@ -174,9 +174,10 @@ func (c *Client) idleCleanup() {
|
||||
|
||||
func (c *Client) idleCleanupExpTime(expTime time.Time) {
|
||||
activeCount := 0
|
||||
sessionToClose := make([]*Session, 0, c.idleSession.Len())
|
||||
|
||||
c.idleSessionLock.Lock()
|
||||
sessionToClose := make([]*Session, 0, c.idleSession.Len())
|
||||
|
||||
it := c.idleSession.Iterate()
|
||||
for it.IsNotEnd() {
|
||||
session := it.Value()
|
||||
|
||||
Reference in new issue
Block a user