fix conn tracker memory leak #1056

This commit is contained in:
Alireza Ahmadi
2026-03-22 18:29:58 +01:00
parent 1ef0ffa60e
commit 237707b31c
3 changed files with 28 additions and 0 deletions
+8
View File
@@ -34,6 +34,14 @@ func NewStatsTracker() *StatsTracker {
}
}
func (c *StatsTracker) Reset() {
c.access.Lock()
defer c.access.Unlock()
c.inbounds = make(map[string]Counter)
c.outbounds = make(map[string]Counter)
c.users = make(map[string]Counter)
}
func (c *StatsTracker) getReadCounters(inbound string, outbound string, user string) ([]*atomic.Int64, []*atomic.Int64) {
var readCounter []*atomic.Int64
var writeCounter []*atomic.Int64