mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-07-04 01:07:49 +02:00
perf(dot): implement connection pooling for improved performance
Implement TCP/TLS connection pooling for DoT resolver to match DoQ performance. Previously, DoT created a new TCP/TLS connection for every DNS query, incurring significant TLS handshake overhead. Now connections are reused across queries, eliminating this overhead for subsequent requests. The implementation follows the same pattern as DoQ, using parallel dialing and connection pooling to achieve comparable performance characteristics.
This commit is contained in:
committed by
Cuong Manh Le
parent
2e8a0f00a0
commit
acbebcf7c2
@@ -21,6 +21,10 @@ type doqResolver struct {
|
||||
}
|
||||
|
||||
func (r *doqResolver) Resolve(ctx context.Context, msg *dns.Msg) (*dns.Msg, error) {
|
||||
if err := validateMsg(msg); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Get the appropriate connection pool based on DNS type and IP stack
|
||||
dnsTyp := uint16(0)
|
||||
if msg != nil && len(msg.Question) > 0 {
|
||||
|
||||
Reference in New Issue
Block a user