From a4ac06b8c3d54c099a3aacbd4915e61757ac1586 Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Sun, 18 Dec 2011 13:33:03 +0100 Subject: [PATCH] Fix comments after RRs zzzzz.miek.nl. 86400 IN RRSIG NSEC 8 3 86400 20110823011301 20110724011301 12051 miek.nl. lyRljEQFOmajcdo6bBI67DsTlQTGU3ag9vlE07u7ynqt9aYBXyE9mkasAK4V0oI32YGb2pOSB6RbbdHwUmSt+cYhOA49tl2t0Qoi3pH21dicJiupdZuyjfqUEqJlQoEhNXGtP/pRvWjNA4pQeOsOAoWq/BDcWCSQB9mh2LvUOH4= ; {keyid = sksak} zzzzz.miek.nl. 86400 IN NSEC miek.nl. TXT RRSIG NSEC Is now parsed correctly. This is incidently the format as echoed by ldns. --- zscan.go | 17 ++++++++++++----- zscan_rr.go | 2 ++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/zscan.go b/zscan.go index a7d9f462..32d1852e 100644 --- a/zscan.go +++ b/zscan.go @@ -26,9 +26,9 @@ const ( _RRTYPE _OWNER _CLASS - _DIRORIGIN // $ORIGIN - _DIRTTL // $TTL - _INCLUDE // $INCLUDE + _DIRORIGIN // $ORIGIN + _DIRTTL // $TTL + _INCLUDE // $INCLUDE // Privatekey file _VALUE @@ -330,17 +330,24 @@ func zlexer(s scanner.Scanner, c chan lex) { commt = false rrtype = false str = "" + // If not in a brace this ends the comment AND the RR + if brace == 0 { + owner = true + } + l.value = _NEWLINE + l.token = "\n" + c <- l break } if str != "" { l.value = _STRING l.token = str - if !rrtype { + if !rrtype { if _, ok := Str_rr[strings.ToUpper(l.token)]; ok { l.value = _RRTYPE rrtype = true } - } + } c <- l } if brace > 0 { diff --git a/zscan_rr.go b/zscan_rr.go index 97e92440..abf23f07 100644 --- a/zscan_rr.go +++ b/zscan_rr.go @@ -267,6 +267,7 @@ func setRRSIG(h RR_Header, c chan lex) (RR, *ParseError) { l = <-c s := "" for l.value != _NEWLINE && l.value != _EOF { + println("Wat hebben we hier", l.token, l.value) switch l.value { case _STRING: s += l.token @@ -277,6 +278,7 @@ func setRRSIG(h RR_Header, c chan lex) (RR, *ParseError) { } l = <-c } + println("S", s) rr.Signature = s return rr, nil }