Some small fixes

This commit is contained in:
Miek Gieben 2015-07-27 22:12:46 +01:00
parent a34cf6798a
commit 179a68fbec
3 changed files with 6 additions and 6 deletions

View File

@ -1480,7 +1480,7 @@ func TestParseCAA(t *testing.T) {
func TestParseURI(t *testing.T) { func TestParseURI(t *testing.T) {
lt := map[string]string{ lt := map[string]string{
"_http._tcp IN URI 10 1 \"http://www.example.com/path\"": "_http._tcp\t3600\tIN\tURI\t10 1 \"http://www.example.com/path\"", "_http._tcp. IN URI 10 1 \"http://www.example.com/path\"": "_http._tcp.\t3600\tIN\tURI\t10 1 \"http://www.example.com/path\"",
} }
for i, o := range lt { for i, o := range lt {
rr, err := NewRR(i) rr, err := NewRR(i)

View File

@ -1337,7 +1337,7 @@ func (rr *URI) copy() RR { return &URI{*rr.Hdr.copyHeader(), rr.Weight
func (rr *URI) len() int { return rr.Hdr.len() + 4 + len(rr.Target) } func (rr *URI) len() int { return rr.Hdr.len() + 4 + len(rr.Target) }
func (rr *URI) String() string { func (rr *URI) String() string {
return rr.Hdr.String() + strconv.Itoa(int(rr.Priority)) + return rr.Hdr.String() + strconv.Itoa(int(rr.Priority)) +
" " + strconv.Itoa(int(rr.Weight)) + sprintTxtOctet(rr.Target) " " + strconv.Itoa(int(rr.Weight)) + " " + sprintTxtOctet(rr.Target)
} }
type DHCID struct { type DHCID struct {

View File

@ -1890,9 +1890,9 @@ func setURI(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) {
rr.Weight = uint16(i) rr.Weight = uint16(i)
<-c // zBlank <-c // zBlank
s, e, c1 := endingToTxtSlice(c, "bad URI Target", f) s, err, c1 := endingToTxtSlice(c, "bad URI Target", f)
if e != nil { if err != nil {
return nil, e.(*ParseError), "" return nil, err, ""
} }
rr.Target = s[0] rr.Target = s[0]
return rr, nil, c1 return rr, nil, c1
@ -2180,7 +2180,7 @@ func setCAA(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) {
} }
rr.Flag = uint8(i) rr.Flag = uint8(i)
<-c // zBlank <-c // zBlank
l = <-c // zString l = <-c // zString
if l.value != zString { if l.value != zString {
return nil, &ParseError{f, "bad CAA Tag", l}, "" return nil, &ParseError{f, "bad CAA Tag", l}, ""