mirror of
https://github.com/m13253/dns-over-https.git
synced 2026-05-29 15:44:09 +00:00
Detect context.DeadlineExceeded
This commit is contained in:
@@ -92,6 +92,13 @@ func (c *Client) generateRequestGoogle(ctx context.Context, w dns.ResponseWriter
|
||||
c.httpClientMux.RLock()
|
||||
resp, err := c.httpClient.Do(req)
|
||||
c.httpClientMux.RUnlock()
|
||||
if err == context.DeadlineExceeded {
|
||||
// Do not respond, silently fail to prevent caching of SERVFAIL
|
||||
log.Println(err)
|
||||
return &DNSRequest{
|
||||
err: err,
|
||||
}
|
||||
}
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
reply := jsonDNS.PrepareReply(r)
|
||||
|
||||
Reference in New Issue
Block a user