diff --git a/edns.go b/edns.go index 059b7633..e9e9e42e 100644 --- a/edns.go +++ b/edns.go @@ -108,6 +108,8 @@ func (rr *OPT) copy() RR { return &OPT{*rr.Hdr.copyHeader(), rr.Option} } +// return the old value -> delete SetVersion + // Version returns the EDNS version used. Only zero is defined. func (rr *OPT) Version() uint8 { return uint8(rr.Hdr.Ttl & 0x00FF00FFFF) diff --git a/parse_test.go b/parse_test.go index 2289fb02..9711ebf9 100644 --- a/parse_test.go +++ b/parse_test.go @@ -371,7 +371,8 @@ func TestParseFailure(t *testing.T) { } } -// A bit useless, how to use b.N? +/* +// A bit useless, how to use b.N?. It always returns 0 func BenchmarkZoneParsing(b *testing.B) { b.StopTimer() f, err := os.Open("t/miek.nl.signed_test") @@ -386,6 +387,7 @@ func BenchmarkZoneParsing(b *testing.B) { } } } +*/ func TestZoneParsing(t *testing.T) { f, err := os.Open("t/miek.nl.signed_test") diff --git a/server_test.go b/server_test.go index 36dd61a9..d247a827 100644 --- a/server_test.go +++ b/server_test.go @@ -5,6 +5,7 @@ package dns import ( + "runtime" "testing" "time" ) @@ -59,8 +60,8 @@ func TestServing(t *testing.T) { func BenchmarkServing(b *testing.B) { b.StopTimer() - // Again start a server HandleFunc("miek.nl.", HelloServer) + a := runtime.GOMAXPROCS(4) go func() { ListenAndServe("127.0.0.1:8053", "udp", nil) }() @@ -73,6 +74,7 @@ func BenchmarkServing(b *testing.B) { for i := 0; i < b.N; i++ { c.Exchange(m, "127.0.0.1:8053") } + runtime.GOMAXPROCS(a) } func TestDotAsCatchAllWildcard(t *testing.T) {