@ -279,27 +279,31 @@ func SetControlHealth(problems []string) {
// GotStreamedMapResponse notes that we got a tailcfg.MapResponse
// GotStreamedMapResponse notes that we got a tailcfg.MapResponse
// message in streaming mode, even if it's just a keep-alive message.
// message in streaming mode, even if it's just a keep-alive message.
//
// This also notes that a map poll is in progress. To unset that, call
// SetOutOfPollNetMap().
func GotStreamedMapResponse ( ) {
func GotStreamedMapResponse ( ) {
mu . Lock ( )
mu . Lock ( )
defer mu . Unlock ( )
defer mu . Unlock ( )
lastStreamedMapResponse = time . Now ( )
lastStreamedMapResponse = time . Now ( )
if ! inMapPoll {
inMapPoll = true
inMapPollSince = time . Now ( )
}
selfCheckLocked ( )
selfCheckLocked ( )
}
}
// SetInPollNetMap records whether the client has an open
// Set OutOfPollNetMap records that the client is no longer i n
// HTTP long poll open to the control plane.
// an HTTP map request long poll to the control plane.
func Set InPollNetMap( v bool ) {
func Set OutOfPollNetMap( ) {
mu . Lock ( )
mu . Lock ( )
defer mu . Unlock ( )
defer mu . Unlock ( )
if v == inMapPoll {
if ! inMapPoll {
return
return
}
}
inMapPoll = v
inMapPoll = false
if v {
lastMapPollEndedAt = time . Now ( )
inMapPollSince = time . Now ( )
selfCheckLocked ( )
} else {
lastMapPollEndedAt = time . Now ( )
}
}
}
// GetInPollNetMap reports whether the client has an open
// GetInPollNetMap reports whether the client has an open