Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions monitor_shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@ func (m *defaultInterfaceMonitor) Start() error {
return nil
}

var accessDelayCheckUpdate sync.Mutex

func (m *defaultInterfaceMonitor) delayCheckUpdate() {
accessDelayCheckUpdate.Lock()
defer accessDelayCheckUpdate.Unlock()

if m.checkUpdateTimer == nil {
m.checkUpdateTimer = time.AfterFunc(time.Second, m.postCheckUpdate)
} else {
Expand Down
2 changes: 2 additions & 0 deletions stack_system_nat.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ func (n *TCPNat) LookupBack(port uint16) *TCPSession {
session := n.portMap[port]
n.portAccess.RUnlock()
if session != nil {
n.portAccess.Lock()
session.LastActive = time.Now()
n.portAccess.Unlock()
}
return session
}
Expand Down