fix merge conflict

This commit is contained in:
Miek Gieben 2012-09-01 17:20:05 +02:00
commit 9a5ffa1038
6 changed files with 15 additions and 15 deletions

View File

@ -1,4 +1,4 @@
Extensions from the original work are copyright (c) 2010 - 2012 Miek Gieben
Extensions of the original work are copyright (c) 2010 - 2012 Miek Gieben
As this is fork of the official Go code the same license applies:

View File

@ -8,7 +8,6 @@ import (
"time"
)
// hijacked connections...?
type reply struct {
client *Client
addr string
@ -21,7 +20,8 @@ type reply struct {
t time.Time
}
// A nil Client is usable.
// A Client defines parameter for a DNS client. A nil
// Client is usable for sending queries.
type Client struct {
Net string // if "tcp" a TCP query will be initiated, otherwise an UDP one (default is "", is UDP)
Attempts int // number of attempts, if not set defaults to 1
@ -32,9 +32,7 @@ type Client struct {
}
func (w *reply) RemoteAddr() net.Addr {
if w.conn == nil {
return nil
} else {
if w.conn != nil {
return w.conn.RemoteAddr()
}
return nil

5
dns.go
View File

@ -10,9 +10,10 @@
// The package allows complete control over what is send out to the DNS. The package
// API follows the less-is-more principle, by presenting a small, clean interface.
//
// The package dns supports (async) querying/replying, incoming/outgoing AXFR/IXFR,
// The package dns supports (asynchronous) querying/replying, incoming/outgoing AXFR/IXFR,
// TSIG, EDNS0, dynamic updates, notifies and DNSSEC validation/signing.
// Note that domain names MUST be fully qualified, before sending them.
// Note that domain names MUST be fully qualified, before sending them, unqualified
// names in a message will result in a packing failure.
//
// Resource records are native types. They are not stored in wire format.
// Basic usage pattern for creating a new resource record:

View File

@ -278,6 +278,12 @@ func (srv *Server) serveUDP(l *net.UDPConn) error {
srv.UDPSize = udpMsgSize
}
for {
if srv.ReadTimeout != 0 {
l.SetReadDeadline(time.Now().Add(srv.ReadTimeout))
}
if srv.WriteTimeout != 0 {
l.SetWriteDeadline(time.Now().Add(srv.WriteTimeout))
}
m := make([]byte, srv.UDPSize)
n, a, e := l.ReadFromUDP(m)
if e != nil || n == 0 {
@ -286,12 +292,6 @@ func (srv *Server) serveUDP(l *net.UDPConn) error {
}
m = m[:n]
if srv.ReadTimeout != 0 {
l.SetReadDeadline(time.Now().Add(srv.ReadTimeout))
}
if srv.WriteTimeout != 0 {
l.SetWriteDeadline(time.Now().Add(srv.WriteTimeout))
}
d, err := newConn(nil, l, a, m, handler, srv.TsigSecret)
if err != nil {
continue

View File

@ -71,6 +71,7 @@ const (
TypeMAILB uint16 = 253
TypeMAILA uint16 = 254
TypeANY uint16 = 255
TypeURI uint16 = 256
TypeTA uint16 = 32768
TypeDLV uint16 = 32769

View File

@ -118,7 +118,7 @@ func (z *Zone) Insert(r RR) error {
return nil
}
// Remove removes the RR r from the zone. If there RR can not be found,
// Remove removes the RR r from the zone. If the RR can not be found,
// this is a no-op.
func (z *Zone) Remove(r RR) error {
key := toRadixName(r.Header().Name)