Add TLS resolver connection reusing and pooling

Also, fix caching issues and add more tests
This commit is contained in:
Daniel
2020-05-15 22:43:06 +02:00
parent dd837e40e2
commit 53eb309e72
11 changed files with 510 additions and 61 deletions

View File

@@ -65,12 +65,12 @@ func ResolveIPAndValidate(ctx context.Context, ip string, securityLevel uint8) (
for _, rr := range rrCache.Answer {
switch v := rr.(type) {
case *dns.A:
log.Infof("A: %s", v.A.String())
// log.Debugf("A: %s", v.A.String())
if ip == v.A.String() {
return ptrName, nil
}
case *dns.AAAA:
log.Infof("AAAA: %s", v.AAAA.String())
// log.Debugf("AAAA: %s", v.AAAA.String())
if ip == v.AAAA.String() {
return ptrName, nil
}