mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-12 05:37:32 +00:00
ipn/localapi: add debug (root-required) access to inject debug Notify
For testing of Windows GUI client. Updates #6480 Change-Id: I42f7526d95723e14bed7085fb759e371b43aa9da Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:

committed by
Brad Fitzpatrick

parent
96cad35870
commit
57124e2126
@@ -1820,6 +1820,13 @@ func (b *LocalBackend) pollRequestEngineStatus(ctx context.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
// DebugNotify injects a fake notify message to clients.
|
||||
//
|
||||
// It should only be used via the LocalAPI's debug handler.
|
||||
func (b *LocalBackend) DebugNotify(n ipn.Notify) {
|
||||
b.send(n)
|
||||
}
|
||||
|
||||
// send delivers n to the connected frontend and any API watchers from
|
||||
// LocalBackend.WatchNotifications (via the LocalAPI).
|
||||
//
|
||||
@@ -1828,7 +1835,9 @@ func (b *LocalBackend) pollRequestEngineStatus(ctx context.Context) {
|
||||
//
|
||||
// b.mu must not be held.
|
||||
func (b *LocalBackend) send(n ipn.Notify) {
|
||||
n.Version = version.Long
|
||||
if n.Version == "" {
|
||||
n.Version = version.Long
|
||||
}
|
||||
|
||||
b.mu.Lock()
|
||||
notifyFunc := b.notify
|
||||
|
Reference in New Issue
Block a user