mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 10:10:08 -08:00
don't trigger connection closed on read and write goroutines
This commit is contained in:
parent
03b6caa597
commit
e0e61907ce
1 changed files with 1 additions and 8 deletions
|
|
@ -107,13 +107,7 @@ func (c *Client) readCommands() {
|
|||
}
|
||||
|
||||
m.SetClient(c)
|
||||
if DEBUG_CLIENT {
|
||||
log.Printf("%s sending %s", c, m)
|
||||
}
|
||||
c.server.Command(m)
|
||||
if DEBUG_CLIENT {
|
||||
log.Printf("%s sent %s", c, m)
|
||||
}
|
||||
}
|
||||
c.ConnectionClosed()
|
||||
}
|
||||
|
|
@ -124,12 +118,11 @@ func (client *Client) writeReplies() {
|
|||
log.Printf("%s ← %s", client, reply)
|
||||
}
|
||||
|
||||
if err := client.socket.Write(reply.Format(client)); err != nil {
|
||||
if client.socket.Write(reply.Format(client)) != nil {
|
||||
close(client.replies)
|
||||
}
|
||||
}
|
||||
client.replies = nil
|
||||
client.ConnectionClosed()
|
||||
}
|
||||
|
||||
func (client *Client) Destroy() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue