fix(handler/dns): buffer pool leak, write deadline, async error logging, EDNS0 buffer
Fix bufpool leak when PackBuffer fails by extracting packResponse helper. Add write deadline before conn.Write to prevent goroutine hangs on slow clients. Log async exchange errors instead of silently discarding them. Raise defaultBufferSize from 1024 to 4096 to match EDNS0 standard. Deduplicate lookupHosts TypeA/TypeAAAA branches.
This commit is contained in:
@@ -13,7 +13,7 @@ const (
|
||||
// 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
|
||||
defaultBufferSize = 4096
|
||||
)
|
||||
|
||||
// metadata holds parsed DNS handler configuration.
|
||||
|
||||
Reference in New Issue
Block a user