mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 06:36:43 +00:00
cmd/ensdns: Replace LGPL header with GPL header
This commit is contained in:
parent
b952a1a508
commit
bf934ca029
1 changed files with 23 additions and 8 deletions
|
|
@ -1,18 +1,18 @@
|
||||||
// Copyright 2016 The go-ethereum Authors
|
// Copyright 2014 The go-ethereum Authors
|
||||||
// This file is part of the go-ethereum library.
|
// This file is part of go-ethereum.
|
||||||
//
|
//
|
||||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
// go-ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU Lesser General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
//
|
//
|
||||||
// The go-ethereum library is distributed in the hope that it will be useful,
|
// go-ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU Lesser General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|
@ -85,9 +85,24 @@ func (ed *ENSDNS) Handle(w dns.ResponseWriter, r *dns.Msg) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("Error resolving query %v: %v", question, err)
|
log.Printf("Error resolving query %v: %v", question, err)
|
||||||
m.Rcode = dns.RcodeServerFailure
|
m.Rcode = dns.RcodeServerFailure
|
||||||
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If no answer is found, and this wasn't a CNAME or * query, try looking for CNAMEs
|
||||||
|
if len(answers) == 0 && question.Qtype != dns.TypeCNAME && question.Qtype != dns.TypeANY {
|
||||||
|
question.Qtype = dns.TypeCNAME
|
||||||
|
answers, err = ed.resolve(question)
|
||||||
|
if err != nil {
|
||||||
|
log.Printf("Error resolving query %v: %v", question, err)
|
||||||
|
m.Rcode = dns.RcodeServerFailure
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
m.Answer = append(m.Answer, answers...)
|
m.Answer = append(m.Answer, answers...)
|
||||||
|
m.Authoritative = true
|
||||||
}
|
}
|
||||||
|
|
||||||
w.WriteMsg(m)
|
w.WriteMsg(m)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue