diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-02-28 07:19:06 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-02-28 08:05:02 +0100 |
commit | cabb405c67b9dae13be312198640bb10ce5a07a3 (patch) | |
tree | 243e106096b2df0f27074234d6acd56d518fb407 /service/ipc_server.go | |
parent | manager: wire up config migrator (diff) | |
download | wireguard-windows-cabb405c67b9dae13be312198640bb10ce5a07a3.tar.xz wireguard-windows-cabb405c67b9dae13be312198640bb10ce5a07a3.zip |
service: track tunnel service status
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to '')
-rw-r--r-- | service/ipc_server.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/service/ipc_server.go b/service/ipc_server.go index 4388bb00..3e4c7fd3 100644 --- a/service/ipc_server.go +++ b/service/ipc_server.go @@ -150,7 +150,7 @@ func IPCServerListen(reader *os.File, writer *os.File, events *os.File) error { return nil } -func notifyAll(notificationType NotificationType, iface interface{}) { +func notifyAll(notificationType NotificationType, ifaces ...interface{}) { if len(managerServices) == 0 { return } @@ -161,7 +161,7 @@ func notifyAll(notificationType NotificationType, iface interface{}) { if err != nil { return } - if iface != nil { + for _, iface := range ifaces { err = encoder.Encode(iface) if err != nil { return @@ -178,10 +178,10 @@ func notifyAll(notificationType NotificationType, iface interface{}) { managerServicesLock.RUnlock() } -func IPCServerNotifyTunnelChange(name string) { - notifyAll(TunnelChangeNotificationType, name) +func IPCServerNotifyTunnelChange(name string, state TunnelState) { + notifyAll(TunnelChangeNotificationType, name, state) } func IPCServerNotifyTunnelsChange() { - notifyAll(TunnelsChangeNotificationType, nil) + notifyAll(TunnelsChangeNotificationType) } |