mirror of
https://github.com/tailscale/tailscale.git
synced 2025-01-05 14:57:49 +00:00
ipn: set BackendServer's notify earlier; don't require Start
We've been slowly making Start less special and making IPN a multi-connection "watch" bus of changes, but this Start specialness had remained. Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
8e4d1e3f2c
commit
d9ee9a0d3f
@ -94,11 +94,13 @@ type BackendServer struct {
|
||||
}
|
||||
|
||||
func NewBackendServer(logf logger.Logf, b Backend, sendNotifyMsg func(b []byte)) *BackendServer {
|
||||
return &BackendServer{
|
||||
bs := &BackendServer{
|
||||
logf: logf,
|
||||
b: b,
|
||||
sendNotifyMsg: sendNotifyMsg,
|
||||
}
|
||||
b.SetNotifyCallback(bs.send)
|
||||
return bs
|
||||
}
|
||||
|
||||
func (bs *BackendServer) send(n Notify) {
|
||||
@ -188,7 +190,6 @@ func (bs *BackendServer) GotCommand(ctx context.Context, cmd *Command) error {
|
||||
bs.GotQuit = true
|
||||
return errors.New("Quit command received")
|
||||
} else if c := cmd.Start; c != nil {
|
||||
bs.b.SetNotifyCallback(bs.send)
|
||||
opts := c.Opts
|
||||
return bs.b.Start(opts)
|
||||
} else if c := cmd.StartLoginInteractive; c != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user