mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-30 09:18:34 +00:00
DNS: Retry with EDNS0 when response is truncated (#4516)
This commit is contained in:
parent
6f8e253dec
commit
86a225cda1
3 changed files with 49 additions and 15 deletions
|
@ -31,10 +31,11 @@ type record struct {
|
|||
|
||||
// IPRecord is a cacheable item for a resolved domain
|
||||
type IPRecord struct {
|
||||
ReqID uint16
|
||||
IP []net.Address
|
||||
Expire time.Time
|
||||
RCode dnsmessage.RCode
|
||||
ReqID uint16
|
||||
IP []net.Address
|
||||
Expire time.Time
|
||||
RCode dnsmessage.RCode
|
||||
RawHeader *dnsmessage.Header
|
||||
}
|
||||
|
||||
func (r *IPRecord) getIPs() ([]net.Address, error) {
|
||||
|
@ -179,9 +180,10 @@ func parseResponse(payload []byte) (*IPRecord, error) {
|
|||
|
||||
now := time.Now()
|
||||
ipRecord := &IPRecord{
|
||||
ReqID: h.ID,
|
||||
RCode: h.RCode,
|
||||
Expire: now.Add(time.Second * 600),
|
||||
ReqID: h.ID,
|
||||
RCode: h.RCode,
|
||||
Expire: now.Add(time.Second * 600),
|
||||
RawHeader: &h,
|
||||
}
|
||||
|
||||
L:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue