From 4e6a465d8c5f450abf58fc22325b17dd2bf0e465 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Tue, 14 Jun 2022 13:05:40 -0700 Subject: [PATCH] tailcfg: clarify some of the MapRequest variants Change-Id: Ia09bd69856e372c3a6b64cda7ddb34029b32a11b Signed-off-by: Brad Fitzpatrick (cherry picked from commit 4005134263db39b5a9e0f13f6db0e260f871a5c7) --- tailcfg/tailcfg.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tailcfg/tailcfg.go b/tailcfg/tailcfg.go index d32f8edf9..a6e16a8c1 100644 --- a/tailcfg/tailcfg.go +++ b/tailcfg/tailcfg.go @@ -878,13 +878,20 @@ type MapRequest struct { // start-up before their first real endpoint update. ReadOnly bool `json:",omitempty"` - // OmitPeers is whether the client is okay with the Peers list - // being omitted in the response. (For example, a client on - // start up using ReadOnly to get the DERP map.) + // OmitPeers is whether the client is okay with the Peers list being omitted + // in the response. + // + // The behavior of OmitPeers being true varies based on Stream and ReadOnly: // // If OmitPeers is true, Stream is false, and ReadOnly is false, // then the server will let clients update their endpoints without // breaking existing long-polling (Stream == true) connections. + // In this case, the server can omit the entire response; the client + // only checks the HTTP response status code. + // + // If OmitPeers is true, Stream is false, but ReadOnly is true, + // then all the response fields are included. (This is what the client does + // when initially fetching the DERP map.) OmitPeers bool `json:",omitempty"` // DebugFlags is a list of strings specifying debugging and