fix(handler/dns): apply readTimeout, fix async context leak, add 40 tests
- Apply parsed readTimeout as connection read deadline (was dead code) - Use context.WithoutCancel for async cache refresh goroutine - Add doc comments to all exported symbols - Add 40 tests covering metadata parsing, init, rate limiting, exchanger selection, host lookup, cache, bypass, async refresh, and concurrent request handling
This commit is contained in:
@@ -10,10 +10,13 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
defaultTimeout = 5 * time.Second
|
||||
// defaultTimeout is the fallback timeout for DNS exchanges.
|
||||
defaultTimeout = 5 * time.Second
|
||||
// defaultBufferSize is the fallback buffer size for DNS message I/O.
|
||||
defaultBufferSize = 1024
|
||||
)
|
||||
|
||||
// metadata holds parsed DNS handler configuration.
|
||||
type metadata struct {
|
||||
readTimeout time.Duration
|
||||
ttl time.Duration
|
||||
|
||||
Reference in New Issue
Block a user