1
0
Fork 0
forked from External/ergo

don't double-close socket

This commit is contained in:
Jeremy Latt 2014-02-14 19:05:30 -08:00
parent 4d9742d033
commit 3a9027e3dc
3 changed files with 2 additions and 7 deletions

View file

@ -19,17 +19,15 @@ type Client struct {
idleTimer *time.Timer
invisible bool
loginTimer *time.Timer
mutex *sync.Mutex
nick string
operator bool
phase Phase
quitTimer *time.Timer
realname string
registered bool
replies chan Reply
server *Server
socket *Socket
mutex *sync.Mutex
authorized bool
username string
}
@ -119,7 +117,7 @@ func (c *Client) readCommands() {
c.server.Command(m)
}
if c.registered {
if c.phase == Normal {
c.ConnectionClosed()
} else {
c.Destroy()