Send Names reply in multiple messages.

This commit is contained in:
Jeremy Latt 2013-06-02 22:07:50 -07:00
parent 0001131095
commit f133f3691d
8 changed files with 235 additions and 133 deletions

View file

@ -48,7 +48,6 @@ func NewClient(server *Server, conn net.Conn) *Client {
func (c *Client) readConn(recv <-chan string) {
for str := range recv {
m, err := ParseCommand(str)
if err != nil {
if err == NotEnoughArgsError {
@ -59,7 +58,7 @@ func (c *Client) readConn(recv <-chan string) {
continue
}
m.SetClient(c)
m.SetBase(c)
c.server.commands <- m
}
}
@ -69,7 +68,7 @@ func (c *Client) writeConn(write chan<- string, replies <-chan Reply) {
if DEBUG_CLIENT {
log.Printf("%s ← %s : %s", c, reply.Source(), reply)
}
write <- reply.Format(c)
reply.Format(c, write)
}
}