implement Hijack

This commit is contained in:
Miek Gieben 2012-08-28 19:41:23 +02:00
parent 9e318901a6
commit 0eae2d1735
1 changed files with 6 additions and 0 deletions

View File

@ -32,6 +32,9 @@ type ResponseWriter interface {
TsigStatus() error
// TsigTimersOnly sets the tsig timers only boolean.
TsigTimersOnly(bool)
// Hijack lets the caller take over the connection.
// After a call to Hijack(), the DNS package will not do anything with the connection
Hijack()
}
type conn struct {
@ -417,6 +420,9 @@ func (w *response) TsigStatus() error { return w.tsigStatus }
// TsigTimersOnly implements the ResponseWriter.TsigTimersOnly method.
func (w *response) TsigTimersOnly(b bool) { w.tsigTimersOnly = b }
// Hijack implements the ResponseWriter.Hijack method.
func (w *response) Hijack() { w.hijacked = true }
// Close implements the ResponseWriter.Close method
func (w *response) Close() error {
if w.conn._UDP != nil {