diff --git a/zscan.go b/zscan.go index 4508c29f..ff9ef664 100644 --- a/zscan.go +++ b/zscan.go @@ -9,7 +9,7 @@ import ( ) // Only used when debugging the parser itself. -var _DEBUG = true +var _DEBUG = false // Tokinize a RFC 1035 zone file. The tokenizer will normalize it: // * Add ownernames if they are left blank; @@ -222,6 +222,11 @@ func ParseZone(r io.Reader, t chan Token) { // I could save my token here...? l r, e := setRR(h, c) if e != nil { + // If e.Lex is nil than we have encounter a unknown RR type + // in that case we substitute our current Lex token + if e.lex.token == "" && e.lex.value == 0 { + e.lex = l // Uh, dirty + } t <- Token{Error: e} return } diff --git a/zscan_rr.go b/zscan_rr.go index bbeea6ea..cf0fb412 100644 --- a/zscan_rr.go +++ b/zscan_rr.go @@ -205,16 +205,19 @@ func setSOA(h RR_Header, c chan Lex) (RR, *ParseError) { switch i { case 0: rr.Serial = uint32(j) + <-c // _BLANK case 1: rr.Refresh = uint32(j) + <-c // _BLANK case 2: rr.Retry = uint32(j) + <-c // _BLANK case 3: rr.Expire = uint32(j) + <-c // _BLANK case 4: rr.Minttl = uint32(j) } - <-c // _BLANK } return rr, nil }