Fix printing of the header

Patch from Stéphane Bortzmeyer
This commit is contained in:
Miek Gieben 2010-10-07 08:45:21 +02:00
parent af26ef2532
commit 13e6e74680
1 changed files with 4 additions and 0 deletions

View File

@ -480,6 +480,10 @@ type MsgHdr struct {
//;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 48404
//;; flags: qr aa rd ra;
func (h *MsgHdr) String() string {
if h == nil {
return "<nil> MsgHdr"
}
s := ";; ->>HEADER<<- opcode: " + opcode_str[h.opcode]
s += ", status: " + rcode_str[h.rcode]
s += ", id: " + strconv.Itoa(int(h.id)) + "\n"