mirror of
https://github.com/juanfont/headscale.git
synced 2026-10-25 15:56:49 +09:00
mapper: keep pings when a full update collapses pending changes
A full renders state at drain time but cannot carry a one-shot PingRequest; queue each ping as a ping-only frame after the full.
This commit is contained in:
1 parent
e93f5d6ee0
commit
d4948da301
8 files changed
+385
-5
No files matched your search
@@ -262,6 +262,14 @@ func (mc *multiChannelNodeConn) prependPending(changes ...change.Change) {
|
||||
mc.pendingMu.Unlock()
|
||||
}
|
||||
|
||||
// collapsePendingToFull replaces pending, together with incoming, by a
|
||||
// single full update and the pings it cannot carry ([change.CollapseToFull]).
|
||||
func (mc *multiChannelNodeConn) collapsePendingToFull(incoming []change.Change) {
|
||||
mc.pendingMu.Lock()
|
||||
mc.pending = change.CollapseToFull(mc.id, slices.Concat(mc.pending, incoming))
|
||||
mc.pendingMu.Unlock()
|
||||
}
|
||||
|
||||
// drainPending atomically removes and returns all pending changes.
|
||||
// Returns nil if there are no pending changes.
|
||||
func (mc *multiChannelNodeConn) drainPending() []change.Change {
|
||||
|
||||
Reference in new issue
Block a user