Skip to content

Commit

Permalink
Make the ttl an uint32
Browse files Browse the repository at this point in the history
  • Loading branch information
miekg committed Mar 21, 2013
1 parent 088f2b8 commit 031d6a9
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions unbound.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ type Result struct {
Secure bool // True if the result is secure
Bogus bool // True if a security failure happened
WhyBogus string // String with error when bogus
Ttl int // TTL for the result in seconds
Ttl uint32 // TTL for the result in seconds (0 for unbound versions < 1.4.20)
Rtt time.Duration // Time the query took (not in Unbound)
}

Expand Down Expand Up @@ -222,18 +222,16 @@ func (u *Unbound) Resolve(name string, rrtype, rrclass uint16) (*Result, error)
r.Secure = res.secure == 1
r.Bogus = res.bogus == 1
r.WhyBogus = C.GoString(res.why_bogus)
println("TTL")
if u.haveTtl() {
println("SETTING TTL")
r.Ttl = int(res.ttl)
r.Ttl = uint32(res.ttl)
}

// Re-create the RRs
var h dns.RR_Header
h.Name = r.Qname
h.Rrtype = r.Qtype
h.Class = r.Qclass
h.Ttl = 0
h.Ttl = r.Ttl

j := 0
if r.HaveData {
Expand Down

0 comments on commit 031d6a9

Please sign in to comment.