From 7691523300c7a7e75575752aa164cc41d2b16394 Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Sat, 12 Oct 2013 12:44:02 +0100 Subject: [PATCH] Re-add ExchangeConn ExchangeConn is back, but with a warning. Other various improvements. --- client.go | 13 ++++++++++++- xfr.go | 19 ------------------- 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/client.go b/client.go index dc57e199..6b90610c 100644 --- a/client.go +++ b/client.go @@ -54,8 +54,19 @@ func Exchange(m *Msg, a string) (r *Msg, err error) { return r, err } -// ExchangeConn performs a sync +// ExchangeConn performs a synchronous query. It sends the message m via the connection +// c and waits for a reply. The connection c is not closed by ExchangeConn. +// This function is going away, but can easily be mimicked: +// +// co := new(dns.Conn) +// co.Conn = c // c is your net.Conn +// co.WriteMsg(m) +// in, _ := co.ReadMsg() +// func ExchangeConn(c net.Conn, m *Msg) (r *Msg, err error) { + println("dns: this function is deprecated") + co := new(Conn) + co.Conn = c if err = co.WriteMsg(m); err != nil { return nil, err } diff --git a/xfr.go b/xfr.go index 0604a53f..9b76ab6e 100644 --- a/xfr.go +++ b/xfr.go @@ -224,22 +224,3 @@ func isSOALast(in *Msg) bool { } return false } -/* -// Close implements the net.Conn Close method. -func (t *Transfer) Close() error { return t.Conn.Close() } - -// LocalAddr implements the net.Conn LocalAddr method. -func (t *Transfer) LocalAddr() net.Addr { return t.Conn.LocalAddr() } - -// RemoteAddr implements the net.Conn RemoteAddr method. -func (t *Transfer) RemoteAddr() net.Addr { return t.Conn.RemoteAddr() } - -// SetDeadline implements the net.Conn SetDeadline method. -func (t *Transfer) SetDeadline(t1 time.Time) error { return t.Conn.SetDeadline(t1) } - -// SetReadDeadline implements the net.Conn SetReadDeadline method. -func (t *Transfer) SetReadDeadline(t1 time.Time) error { return t.Conn.SetReadDeadline(t1) } - -// SetWriteDeadline implements the net.Conn SetWriteDeadline method. -func (t *Transfer) SetWriteDeadline(t1 time.Time) error { return t.Conn.SetWriteDeadline(t1) } -*/