mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-07-28 14:29:57 +00:00
TUN-8861: Add session limiter to UDP session manager
## Summary In order to make cloudflared behavior more predictable and prevent an exhaustion of resources, we have decided to add session limits that can be configured by the user. This first commit introduces the session limiter and adds it to the UDP handling path. For now the limiter is set to run only in unlimited mode.
This commit is contained in:
5
vendor/golang.org/x/net/nettest/conntest.go
generated
vendored
5
vendor/golang.org/x/net/nettest/conntest.go
generated
vendored
@@ -8,7 +8,6 @@ import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"math/rand"
|
||||
"net"
|
||||
"runtime"
|
||||
@@ -173,7 +172,7 @@ func testRacyRead(t *testing.T, c1, c2 net.Conn) {
|
||||
// testRacyWrite tests that it is safe to mutate the input Write buffer
|
||||
// immediately after cancelation has occurred.
|
||||
func testRacyWrite(t *testing.T, c1, c2 net.Conn) {
|
||||
go chunkedCopy(ioutil.Discard, c2)
|
||||
go chunkedCopy(io.Discard, c2)
|
||||
|
||||
var wg sync.WaitGroup
|
||||
defer wg.Wait()
|
||||
@@ -200,7 +199,7 @@ func testRacyWrite(t *testing.T, c1, c2 net.Conn) {
|
||||
|
||||
// testReadTimeout tests that Read timeouts do not affect Write.
|
||||
func testReadTimeout(t *testing.T, c1, c2 net.Conn) {
|
||||
go chunkedCopy(ioutil.Discard, c2)
|
||||
go chunkedCopy(io.Discard, c2)
|
||||
|
||||
c1.SetReadDeadline(aLongTimeAgo)
|
||||
_, err := c1.Read(make([]byte, 1024))
|
||||
|
Reference in New Issue
Block a user