diff options
Diffstat (limited to 'app/web_conn.go')
-rw-r--r-- | app/web_conn.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/web_conn.go b/app/web_conn.go index 92b54723a..1c74e65a5 100644 --- a/app/web_conn.go +++ b/app/web_conn.go @@ -59,7 +59,7 @@ func (a *App) NewWebConn(ws *websocket.Conn, session model.Session, t goi18n.Tra UserId: session.UserId, T: t, Locale: locale, - endWritePump: make(chan struct{}, 1), + endWritePump: make(chan struct{}, 2), pumpFinished: make(chan struct{}, 1), } @@ -111,13 +111,14 @@ func (c *WebConn) Pump() { ch <- struct{}{} }() c.readPump() + c.endWritePump <- struct{}{} <-ch + c.App.HubUnregister(c) c.pumpFinished <- struct{}{} } func (c *WebConn) readPump() { defer func() { - c.App.HubUnregister(c) c.WebSocket.Close() }() c.WebSocket.SetReadLimit(model.SOCKET_MAX_MESSAGE_SIZE_KB) |