forked from External/grumble
Remove client from Server's internal state before shutting everything down (closing channels, sockets, etc.). Attempt to fix spurious cryptResync crash.
This commit is contained in:
parent
7c46c9d140
commit
1827b32d55
1 changed files with 3 additions and 2 deletions
|
|
@ -142,6 +142,9 @@ func (client *Client) Panicf(format string, v ...interface{}) {
|
|||
func (client *Client) disconnect(kicked bool) {
|
||||
if !client.disconnected {
|
||||
client.disconnected = true
|
||||
client.server.RemoveClient(client, kicked)
|
||||
|
||||
// Close the client's UDP reciever goroutine.
|
||||
close(client.udprecv)
|
||||
|
||||
// If the client paniced during authentication, before reaching
|
||||
|
|
@ -163,9 +166,7 @@ func (client *Client) disconnect(kicked bool) {
|
|||
close(client.msgchan)
|
||||
|
||||
client.Printf("Disconnected")
|
||||
|
||||
client.conn.Close()
|
||||
client.server.RemoveClient(client, kicked)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue