mirror of
https://github.com/tailscale/tailscale.git
synced 2025-05-05 15:11:01 +00:00
cmd/derper: add missing read/write timeouts
Updates tailscale/corp#2486 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
9b7fc2ed1f
commit
00b3c1c042
@ -187,6 +187,16 @@ func main() {
|
|||||||
httpsrv := &http.Server{
|
httpsrv := &http.Server{
|
||||||
Addr: *addr,
|
Addr: *addr,
|
||||||
Handler: mux,
|
Handler: mux,
|
||||||
|
|
||||||
|
// Set read/write timeout. For derper, this basically
|
||||||
|
// only affects TLS setup, as read/write deadlines are
|
||||||
|
// cleared on Hijack, which the DERP server does. But
|
||||||
|
// without this, we slowly accumulate stuck TLS
|
||||||
|
// handshake goroutines forever. This also affects
|
||||||
|
// /debug/ traffic, but 30 seconds is plenty for
|
||||||
|
// Prometheus/etc scraping.
|
||||||
|
ReadTimeout: 30 * time.Second,
|
||||||
|
WriteTimeout: 30 * time.Second,
|
||||||
}
|
}
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
|
Loading…
x
Reference in New Issue
Block a user