Fix hijack

This commit is contained in:
Miek Gieben 2012-08-28 19:46:29 +02:00
parent 0eae2d1735
commit b2fadde636
1 changed files with 5 additions and 0 deletions

View File

@ -337,6 +337,7 @@ func (c *conn) serve() {
w.req = req
c.handler.ServeDNS(w, w.req) // this does the writing back to the client
if c.hijacked {
// client takes care of the connection, i.e. calls Close()
return
}
break
@ -345,6 +346,10 @@ func (c *conn) serve() {
c._TCP.Close()
c._TCP = nil
}
if c._UDP != nil {
c._UDP.Close()
c._UDP = nil
}
}
// Write implements the ResponseWriter.Write method.