feat(tsconnect): expose service advertisement to JS #9
@@ -302,6 +302,12 @@ func (c *Auto) restartMap() {
|
|||||||
c.updateControl()
|
c.updateControl()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RestartMap cancels the existing map poll and starts a fresh streaming one,
|
||||||
|
// forcing the control server to send a new full netmap response.
|
||||||
|
func (c *Auto) RestartMap() {
|
||||||
|
c.restartMap()
|
||||||
|
}
|
||||||
|
|
||||||
func (c *Auto) authRoutine() {
|
func (c *Auto) authRoutine() {
|
||||||
defer close(c.authDone)
|
defer close(c.authDone)
|
||||||
bo := backoff.NewBackoff("authRoutine", c.logf, 30*time.Second)
|
bo := backoff.NewBackoff("authRoutine", c.logf, 30*time.Second)
|
||||||
|
|||||||
@@ -4980,9 +4980,16 @@ func (b *LocalBackend) SetExplicitServices(sl []tailcfg.Service) {
|
|||||||
}
|
}
|
||||||
b.hostinfo.Services = sl
|
b.hostinfo.Services = sl
|
||||||
b.explicitServices = sl
|
b.explicitServices = sl
|
||||||
|
ccAuto := b.ccAuto
|
||||||
b.mu.Unlock()
|
b.mu.Unlock()
|
||||||
|
|
||||||
b.doSetHostinfoFilterServices()
|
b.doSetHostinfoFilterServices()
|
||||||
|
// Restart the streaming map poll so the control server sends back a fresh
|
||||||
|
// netmap that includes our updated services in SelfNode, and so peers
|
||||||
|
// receive the update promptly via the control server's push.
|
||||||
|
if ccAuto != nil {
|
||||||
|
ccAuto.RestartMap()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// doSetHostinfoFilterServices calls SetHostinfo on the controlclient,
|
// doSetHostinfoFilterServices calls SetHostinfo on the controlclient,
|
||||||
|
|||||||
Reference in New Issue
Block a user