mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-10 22:19:31 +01:00
don't close replies twice
This commit is contained in:
parent
be01a412d9
commit
7cef494d28
@ -128,10 +128,14 @@ func (client *Client) writeReplies() {
|
||||
}
|
||||
|
||||
if client.socket.Write(reply.Format(client)) != nil {
|
||||
close(client.replies)
|
||||
break
|
||||
}
|
||||
}
|
||||
client.replies = nil
|
||||
|
||||
if client.replies != nil {
|
||||
close(client.replies)
|
||||
client.replies = nil
|
||||
}
|
||||
}
|
||||
|
||||
func (client *Client) Destroy() {
|
||||
@ -147,6 +151,7 @@ func (client *Client) Destroy() {
|
||||
|
||||
if client.replies != nil {
|
||||
close(client.replies)
|
||||
client.replies = nil
|
||||
}
|
||||
|
||||
client.socket.Close()
|
||||
|
Loading…
Reference in New Issue
Block a user