Luke, use the slice

This commit is contained in:
Miek Gieben 2011-04-15 22:32:30 +02:00
parent af25a88821
commit 8d01350deb
1 changed files with 5 additions and 4 deletions

View File

@ -21,7 +21,7 @@ type QueryHandler interface {
// construct an DNS request.
type RequestWriter interface {
WriteMessages([]*Msg)
WriteMessage(*Msg)
Write(*Msg)
}
// hijacked connections...?
@ -171,12 +171,13 @@ func ListenAndQuery(c chan *Msg, handler QueryHandler) {
go client.ListenAndQuery()
}
func (w *reply) WriteMessage(m *Msg) {
func (w *reply) Write(m *Msg) {
// Write to the channel
w.Client.ChannelReply <- []*Msg{m}
w.Client.ChannelReply <- []*Msg{w.req, m}
}
func (w *reply) WriteMessages(m []*Msg) {
// Write to the channel
w.Client.ChannelReply <- m
m1 := append([]*Msg{w.req}, m...) // Really the way?
w.Client.ChannelReply <- m1
}