mirror of
https://github.com/miekg/dns.git
synced 2025-10-10 17:31:01 +02:00
Fix hijack
This commit is contained in:
parent
0eae2d1735
commit
b2fadde636
@ -337,6 +337,7 @@ func (c *conn) serve() {
|
|||||||
w.req = req
|
w.req = req
|
||||||
c.handler.ServeDNS(w, w.req) // this does the writing back to the client
|
c.handler.ServeDNS(w, w.req) // this does the writing back to the client
|
||||||
if c.hijacked {
|
if c.hijacked {
|
||||||
|
// client takes care of the connection, i.e. calls Close()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
@ -345,6 +346,10 @@ func (c *conn) serve() {
|
|||||||
c._TCP.Close()
|
c._TCP.Close()
|
||||||
c._TCP = nil
|
c._TCP = nil
|
||||||
}
|
}
|
||||||
|
if c._UDP != nil {
|
||||||
|
c._UDP.Close()
|
||||||
|
c._UDP = nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write implements the ResponseWriter.Write method.
|
// Write implements the ResponseWriter.Write method.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user