MCPcopy Index your code
hub / github.com/tailscale/tailscale / LoadAndApplyRateConfig

Method LoadAndApplyRateConfig

derp/derpserver/derpserver.go:555–564  ·  view source on GitHub ↗

LoadAndApplyRateConfig reads a [RateConfig] from the file at path and applies it to the server via [Server.UpdateRateLimits].

(path string)

Source from the content-addressed store, hash-verified

553// LoadAndApplyRateConfig reads a [RateConfig] from the file at path and
554// applies it to the server via [Server.UpdateRateLimits].
555func (s *Server) LoadAndApplyRateConfig(path string) error {
556 rc, err := LoadRateConfig(path)
557 if err != nil {
558 return err
559 }
560 applied := s.UpdateRateLimits(rc)
561 s.logf("rate config applied: client-rate=%d bytes/sec, client-burst=%d bytes",
562 applied.PerClientRateLimitBytesPerSec, applied.PerClientRateBurstBytes)
563 return nil
564}
565
566// UpdateRateLimits sets the receive rate limits, updating all existing client
567// connections. It returns the applied config, which may differ from rc. If the

Callers 3

mainFunction · 0.80
watchRateConfigFunction · 0.80

Calls 3

UpdateRateLimitsMethod · 0.95
logfMethod · 0.95
LoadRateConfigFunction · 0.85

Tested by 1