"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "msg.go" between
dns-1.1.45.tar.gz and dns-1.1.46.tar.gz

About: GO DNS implements a DNS library in Go.

msg.go  (dns-1.1.45):msg.go  (dns-1.1.46)
skipping to change at line 904 skipping to change at line 904
// Convert a complete message to a string with dig-like output. // Convert a complete message to a string with dig-like output.
func (dns *Msg) String() string { func (dns *Msg) String() string {
if dns == nil { if dns == nil {
return "<nil> MsgHdr" return "<nil> MsgHdr"
} }
s := dns.MsgHdr.String() + " " s := dns.MsgHdr.String() + " "
s += "QUERY: " + strconv.Itoa(len(dns.Question)) + ", " s += "QUERY: " + strconv.Itoa(len(dns.Question)) + ", "
s += "ANSWER: " + strconv.Itoa(len(dns.Answer)) + ", " s += "ANSWER: " + strconv.Itoa(len(dns.Answer)) + ", "
s += "AUTHORITY: " + strconv.Itoa(len(dns.Ns)) + ", " s += "AUTHORITY: " + strconv.Itoa(len(dns.Ns)) + ", "
s += "ADDITIONAL: " + strconv.Itoa(len(dns.Extra)) + "\n" s += "ADDITIONAL: " + strconv.Itoa(len(dns.Extra)) + "\n"
opt := dns.IsEdns0()
if opt != nil {
// OPT PSEUDOSECTION
s += opt.String() + "\n"
}
if len(dns.Question) > 0 { if len(dns.Question) > 0 {
s += "\n;; QUESTION SECTION:\n" s += "\n;; QUESTION SECTION:\n"
for _, r := range dns.Question { for _, r := range dns.Question {
s += r.String() + "\n" s += r.String() + "\n"
} }
} }
if len(dns.Answer) > 0 { if len(dns.Answer) > 0 {
s += "\n;; ANSWER SECTION:\n" s += "\n;; ANSWER SECTION:\n"
for _, r := range dns.Answer { for _, r := range dns.Answer {
if r != nil { if r != nil {
skipping to change at line 926 skipping to change at line 931
} }
} }
if len(dns.Ns) > 0 { if len(dns.Ns) > 0 {
s += "\n;; AUTHORITY SECTION:\n" s += "\n;; AUTHORITY SECTION:\n"
for _, r := range dns.Ns { for _, r := range dns.Ns {
if r != nil { if r != nil {
s += r.String() + "\n" s += r.String() + "\n"
} }
} }
} }
if len(dns.Extra) > 0 { if len(dns.Extra) > 0 && (opt == nil || len(dns.Extra) > 1) {
s += "\n;; ADDITIONAL SECTION:\n" s += "\n;; ADDITIONAL SECTION:\n"
for _, r := range dns.Extra { for _, r := range dns.Extra {
if r != nil { if r != nil && r.Header().Rrtype != TypeOPT {
s += r.String() + "\n" s += r.String() + "\n"
} }
} }
} }
return s return s
} }
// isCompressible returns whether the msg may be compressible. // isCompressible returns whether the msg may be compressible.
func (dns *Msg) isCompressible() bool { func (dns *Msg) isCompressible() bool {
// If we only have one question, there is nothing we can ever compress. // If we only have one question, there is nothing we can ever compress.
 End of changes. 3 change blocks. 
2 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)