skipping timeout error
This commit is contained in:
parent
fe00189cd6
commit
8a90cc437f
@ -2,9 +2,11 @@ package dnsProxy
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"net"
|
"net"
|
||||||
|
"os"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -85,6 +87,11 @@ func (p DNSProxy) handleDNSRequest(clientAddr *net.UDPAddr, buffer []byte) {
|
|||||||
response := make([]byte, DNSMaxUDPPackageSize)
|
response := make([]byte, DNSMaxUDPPackageSize)
|
||||||
n, err := conn.Read(response)
|
n, err := conn.Read(response)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if errors.Is(err, os.ErrDeadlineExceeded) {
|
||||||
|
// Just skip it
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: Error log level
|
// TODO: Error log level
|
||||||
log.Printf("failed to read response from target DNS: %v", err)
|
log.Printf("failed to read response from target DNS: %v", err)
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user