mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-11 21:27:31 +00:00
control/controlclient: de-pointer Status.PersistView, document more
Updates #cleanup Updates #1909 Change-Id: I31d91e120e3b299508de2136021eab3b34131a44 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:

committed by
Brad Fitzpatrick

parent
7053e19562
commit
f5bfdefa00
@@ -893,7 +893,6 @@ func (b *LocalBackend) SetDecompressor(fn func() (controlclient.Decompressor, er
|
||||
func (b *LocalBackend) SetControlClientStatus(st controlclient.Status) {
|
||||
// The following do not depend on any data for which we need to lock b.
|
||||
if st.Err != nil {
|
||||
// TODO(crawshaw): display in the UI.
|
||||
if errors.Is(st.Err, io.EOF) {
|
||||
b.logf("[v1] Received error: EOF")
|
||||
return
|
||||
@@ -1007,8 +1006,8 @@ func (b *LocalBackend) SetControlClientStatus(st controlclient.Status) {
|
||||
prefs.ControlURL = prefs.ControlURLOrDefault()
|
||||
prefsChanged = true
|
||||
}
|
||||
if st.Persist != nil && st.Persist.Valid() {
|
||||
if !prefs.Persist.View().Equals(*st.Persist) {
|
||||
if st.Persist.Valid() {
|
||||
if !prefs.Persist.View().Equals(st.Persist) {
|
||||
prefsChanged = true
|
||||
prefs.Persist = st.Persist.AsStruct()
|
||||
}
|
||||
|
@@ -162,11 +162,10 @@ func (cc *mockControl) send(err error, url string, loginFinished bool, nm *netma
|
||||
cc.mu.Unlock()
|
||||
}
|
||||
if cc.opts.Observer != nil {
|
||||
pv := cc.persist.View()
|
||||
s := controlclient.Status{
|
||||
URL: url,
|
||||
NetMap: nm,
|
||||
Persist: &pv,
|
||||
Persist: cc.persist.View(),
|
||||
Err: err,
|
||||
}
|
||||
if loginFinished {
|
||||
|
Reference in New Issue
Block a user