mirror of
https://github.com/safing/portmaster
synced 2025-09-04 11:39:29 +00:00
Fix superfluous decision re-evaluations
This commit is contained in:
parent
c8223f1a63
commit
e464ee136c
2 changed files with 14 additions and 1 deletions
|
@ -178,7 +178,8 @@ func NewConnectionFromFirstPacket(pkt packet.Packet) *Connection {
|
||||||
// remote endpoint
|
// remote endpoint
|
||||||
Entity: entity,
|
Entity: entity,
|
||||||
// meta
|
// meta
|
||||||
Started: time.Now().Unix(),
|
Started: time.Now().Unix(),
|
||||||
|
profileRevisionCounter: proc.Profile().RevisionCnt(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -126,6 +126,18 @@ func (lp *LayeredProfile) getValidityFlag() *abool.AtomicBool {
|
||||||
return lp.validityFlag
|
return lp.validityFlag
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RevisionCnt returns the current profile revision counter.
|
||||||
|
func (lp *LayeredProfile) RevisionCnt() (revisionCounter uint64) {
|
||||||
|
if lp == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
lp.lock.Lock()
|
||||||
|
defer lp.lock.Unlock()
|
||||||
|
|
||||||
|
return lp.revisionCounter
|
||||||
|
}
|
||||||
|
|
||||||
// Update checks for updated profiles and replaces any outdated profiles.
|
// Update checks for updated profiles and replaces any outdated profiles.
|
||||||
func (lp *LayeredProfile) Update() (revisionCounter uint64) {
|
func (lp *LayeredProfile) Update() (revisionCounter uint64) {
|
||||||
lp.lock.Lock()
|
lp.lock.Lock()
|
||||||
|
|
Loading…
Add table
Reference in a new issue