mirror of
https://github.com/miekg/dns.git
synced 2025-10-10 17:31:01 +02:00
Close the connection
Patch from: Alex Sergeyev
This commit is contained in:
parent
c0b80818cb
commit
c8f880217f
@ -46,6 +46,7 @@ func (c *Client) Exchange(m *Msg, a string) (r *Msg, rtt time.Duration, err erro
|
|||||||
if err = w.dial(); err != nil {
|
if err = w.dial(); err != nil {
|
||||||
return nil, 0, err
|
return nil, 0, err
|
||||||
}
|
}
|
||||||
|
defer w.conn.Close()
|
||||||
if err = w.send(m); err != nil {
|
if err = w.send(m); err != nil {
|
||||||
return nil, 0, err
|
return nil, 0, err
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user