1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-10 09:50:43 +00:00

handle dns.PackMessage error

this will fix #2599
This commit is contained in:
DuckSoft 2020-06-25 13:52:00 +08:00 committed by Shelikhoo
parent dd106b7cda
commit 780318c5c8
No known key found for this signature in database
GPG Key ID: C4D5E79D22B25316

View File

@ -246,7 +246,11 @@ func (s *DoHNameServer) sendQuery(ctx context.Context, domain string, option IPO
dnsCtx, cancel := context.WithDeadline(dnsCtx, deadline)
defer cancel()
b, _ := dns.PackMessage(r.msg)
b, err := dns.PackMessage(r.msg)
if err != nil {
newError("failed to pack dns query").Base(err).AtError().WriteToLog()
return
}
resp, err := s.dohHTTPSContext(dnsCtx, b.Bytes())
if err != nil {
newError("failed to retrieve response").Base(err).AtError().WriteToLog()