Remove some duplicate worlds (#2582)
Signed-off-by: Nguyen Phuong An <AnNP@vn.fujitsu.com>
This commit is contained in:
parent
3c23aac2d3
commit
e78d9a7893
9 changed files with 9 additions and 9 deletions
|
@ -21,7 +21,7 @@ type Config struct {
|
||||||
// The port to listen on.
|
// The port to listen on.
|
||||||
Port string
|
Port string
|
||||||
|
|
||||||
// Root points to a base directory we we find user defined "things".
|
// Root points to a base directory we find user defined "things".
|
||||||
// First consumer is the file plugin to looks for zone files in this place.
|
// First consumer is the file plugin to looks for zone files in this place.
|
||||||
Root string
|
Root string
|
||||||
|
|
||||||
|
|
|
@ -154,7 +154,7 @@ type gRPCresponse struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write is the hack that makes this work. It does not actually write the message
|
// Write is the hack that makes this work. It does not actually write the message
|
||||||
// but returns the bytes we need to to write in r. We can then pick this up in Query
|
// but returns the bytes we need to write in r. We can then pick this up in Query
|
||||||
// and write a proper protobuf back to the client.
|
// and write a proper protobuf back to the client.
|
||||||
func (r *gRPCresponse) Write(b []byte) (int, error) {
|
func (r *gRPCresponse) Write(b []byte) (int, error) {
|
||||||
r.Msg = new(dns.Msg)
|
r.Msg = new(dns.Msg)
|
||||||
|
|
|
@ -87,7 +87,7 @@ func (a Auto) Walk() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// matches matches re to filename, if is is a match, the subexpression will be used to expand
|
// matches re to filename, if it is a match, the subexpression will be used to expand
|
||||||
// template to an origin. When match is true that origin is returned. Origin is fully qualified.
|
// template to an origin. When match is true that origin is returned. Origin is fully qualified.
|
||||||
func matches(re *regexp.Regexp, filename, template string) (match bool, origin string) {
|
func matches(re *regexp.Regexp, filename, template string) (match bool, origin string) {
|
||||||
base := filepath.Base(filename)
|
base := filepath.Base(filename)
|
||||||
|
|
|
@ -56,7 +56,7 @@ func (z *Zones) Add(zo *file.Zone, name string) {
|
||||||
z.Unlock()
|
z.Unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove removes the zone named name from z. It also stop the the zone's reload goroutine.
|
// Remove removes the zone named name from z. It also stop the zone's reload goroutine.
|
||||||
func (z *Zones) Remove(name string) {
|
func (z *Zones) Remove(name string) {
|
||||||
z.Lock()
|
z.Lock()
|
||||||
|
|
||||||
|
|
|
@ -146,7 +146,7 @@ func TestIsNotify(t *testing.T) {
|
||||||
// need to set opcode
|
// need to set opcode
|
||||||
state.Req.Opcode = dns.OpcodeNotify
|
state.Req.Opcode = dns.OpcodeNotify
|
||||||
|
|
||||||
z.TransferFrom = []string{"10.240.0.1:53"} // IP from from testing/responseWriter
|
z.TransferFrom = []string{"10.240.0.1:53"} // IP from testing/responseWriter
|
||||||
if !z.isNotify(state) {
|
if !z.isNotify(state) {
|
||||||
t.Fatal("Should have been valid notify")
|
t.Fatal("Should have been valid notify")
|
||||||
}
|
}
|
||||||
|
|
|
@ -287,7 +287,7 @@ func TestServices(t *testing.T) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if len(svcs) != 1 {
|
if len(svcs) != 1 {
|
||||||
t.Errorf("Test %d, expected expected 1 answer, got %v", i, len(svcs))
|
t.Errorf("Test %d, expected 1 answer, got %v", i, len(svcs))
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ func newClassRule(nextAction string, args ...string) (Rule, error) {
|
||||||
return &classRule{from, to, nextAction}, nil
|
return &classRule{from, to, nextAction}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Rewrite rewrites the the current request.
|
// Rewrite rewrites the current request.
|
||||||
func (rule *classRule) Rewrite(ctx context.Context, state request.Request) Result {
|
func (rule *classRule) Rewrite(ctx context.Context, state request.Request) Result {
|
||||||
if rule.fromClass > 0 && rule.toClass > 0 {
|
if rule.fromClass > 0 && rule.toClass > 0 {
|
||||||
if state.Req.Question[0].Qclass == rule.fromClass {
|
if state.Req.Question[0].Qclass == rule.fromClass {
|
||||||
|
|
|
@ -30,7 +30,7 @@ func newTypeRule(nextAction string, args ...string) (Rule, error) {
|
||||||
return &typeRule{from, to, nextAction}, nil
|
return &typeRule{from, to, nextAction}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Rewrite rewrites the the current request.
|
// Rewrite rewrites the current request.
|
||||||
func (rule *typeRule) Rewrite(ctx context.Context, state request.Request) Result {
|
func (rule *typeRule) Rewrite(ctx context.Context, state request.Request) Result {
|
||||||
if rule.fromType > 0 && rule.toType > 0 {
|
if rule.fromType > 0 && rule.toType > 0 {
|
||||||
if state.QType() == rule.fromType {
|
if state.QType() == rule.fromType {
|
||||||
|
|
|
@ -130,7 +130,7 @@ func Header(tc Case, resp *dns.Msg) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Section tests if the the section in tc matches rr.
|
// Section tests if the section in tc matches rr.
|
||||||
func Section(tc Case, sec sect, rr []dns.RR) error {
|
func Section(tc Case, sec sect, rr []dns.RR) error {
|
||||||
section := []dns.RR{}
|
section := []dns.RR{}
|
||||||
switch sec {
|
switch sec {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue