derp: throttle client sends if server advertises rate limits

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2021-08-19 11:51:08 -07:00
committed by Brad Fitzpatrick
parent d43fcd2f02
commit 73f177e4d5
3 changed files with 126 additions and 7 deletions

View File

@@ -1079,6 +1079,9 @@ func (s *Server) noteClientActivity(c *sclient) {
type serverInfo struct {
Version int `json:"version,omitempty"`
TokenBucketBytesPerSecond int `json:",omitempty"`
TokenBucketBytesBurst int `json:",omitempty"`
}
func (s *Server) sendServerInfo(bw *lazyBufioWriter, clientKey key.Public) error {