net/dns/resolver: set maxDoHInFlight to 1000 on iOS 15+.

Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
Maisem Ali
2021-10-14 22:39:11 -04:00
committed by Maisem Ali
parent 2662a1c98c
commit 7817ab6b20
3 changed files with 58 additions and 9 deletions

View File

@@ -13,6 +13,7 @@ import (
"time"
dns "golang.org/x/net/dns/dnsmessage"
"tailscale.com/hostinfo"
"tailscale.com/types/dnstype"
)
@@ -140,3 +141,30 @@ func TestGetRCode(t *testing.T) {
})
}
}
func TestMaxDoHInFlight(t *testing.T) {
tests := []struct {
goos string
ver string
want int
}{
{"ios", "", 10},
{"ios", "1532", 10},
{"ios", "9.3.2", 10},
{"ios", "14.3.2", 10},
{"ios", "15.3.2", 1000},
{"ios", "20.3.2", 1000},
{"android", "", 1000},
{"darwin", "", 1000},
{"linux", "", 1000},
}
for _, tc := range tests {
t.Run(fmt.Sprintf("%s-%s", tc.goos, tc.ver), func(t *testing.T) {
hostinfo.SetOSVersion(tc.ver)
got := maxDoHInFlight(tc.goos)
if got != tc.want {
t.Errorf("got %d; want %d", got, tc.want)
}
})
}
}