small tweaks
This commit is contained in:
parent
8a27d18743
commit
26a6d3f833
|
@ -22,7 +22,6 @@ can build servers and resolvers with it.
|
|||
* Fast:
|
||||
* Reply speed around 35/40K qps (faster hardware results in more qps);
|
||||
* Parsing RRs (zone files) with 95/100K RR/s, that's 5M records in about 50 seconds;
|
||||
* This is expected to be optimized further.
|
||||
* Client and server side programming (mimicking the net/http package);
|
||||
* Asynchronous queries/replies for client and server;
|
||||
* DNSSEC: signing, validating and key generation for DSA, RSA and ECDSA;
|
||||
|
@ -33,7 +32,7 @@ can build servers and resolvers with it.
|
|||
|
||||
Have fun!
|
||||
|
||||
Miek Gieben - 2010-2012 - miek@miek.nl
|
||||
Miek Gieben - 2010-2012 - miek@miek.nl
|
||||
|
||||
# Building
|
||||
|
||||
|
|
12
zgenerate.go
12
zgenerate.go
|
@ -102,14 +102,12 @@ BuildRR:
|
|||
if sep == -1 {
|
||||
return "bad modifier in $GENERATE"
|
||||
}
|
||||
//println("checking", s[j+2:j+2+sep])
|
||||
mod, offset, err = modToPrintf(s[j+2 : j+2+sep])
|
||||
if err != "" {
|
||||
return err
|
||||
}
|
||||
j += 2 + sep // Jump to it
|
||||
}
|
||||
//println("mod", mod)
|
||||
dom += fmt.Sprintf(mod, i+offset)
|
||||
default:
|
||||
if escape { // Pretty useless here
|
||||
|
@ -125,6 +123,8 @@ BuildRR:
|
|||
return e.(*ParseError).err
|
||||
}
|
||||
t <- Token{RR: rx}
|
||||
// Its more efficient to first built the rrlist and then parse it in
|
||||
// one go! But is this a problem?
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
@ -147,15 +147,13 @@ func modToPrintf(s string) (string, int, string) {
|
|||
if err != nil {
|
||||
return "", offset, "bad width in $GENERATE"
|
||||
}
|
||||
printf := "%"
|
||||
switch {
|
||||
case width < 0:
|
||||
return "", offset, "bad width in $GENERATE"
|
||||
case width == 0:
|
||||
printf += xs[1]
|
||||
return "%" + xs[1] + xs[2], offset, ""
|
||||
default:
|
||||
printf += "0" + xs[1]
|
||||
return "%0" + xs[1] + xs[2], offset, ""
|
||||
}
|
||||
printf += xs[2]
|
||||
return printf, offset, ""
|
||||
panic("not reached")
|
||||
}
|
||||
|
|
2
zscan.go
2
zscan.go
|
@ -123,7 +123,7 @@ func ReadRR(q io.Reader, filename string) (RR, error) {
|
|||
// Basic usage pattern when reading from a string (z) containing the
|
||||
// zone data:
|
||||
//
|
||||
// for x := range dns.ParseZone(strings.NewReader(z), "", "testzone") {
|
||||
// for x := range dns.ParseZone(strings.NewReader(z), "", "") {
|
||||
// if x.Error != nil {
|
||||
// // Do something with x.RR
|
||||
// }
|
||||
|
|
Loading…
Reference in New Issue