From 5c2ad4eaaecd22e3d22c11cec90f5764fc1815eb Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 19 Jan 2015 09:29:19 -0800 Subject: [PATCH] search: fix websocket crash Fixes #563 Change-Id: Iff04e4a40406ddd391f3c8fc93dcfe0209806ee3 --- pkg/search/websocket.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/search/websocket.go b/pkg/search/websocket.go index b9a1757e1..bb6aec006 100644 --- a/pkg/search/websocket.go +++ b/pkg/search/websocket.go @@ -57,8 +57,8 @@ type wsHub struct { func newWebsocketHub(sh *Handler) *wsHub { return &wsHub{ sh: sh, - register: make(chan *wsConn, buffered), - unregister: make(chan *wsConn, buffered), + register: make(chan *wsConn), // unbuffered; issue 563 + unregister: make(chan *wsConn), // unbuffered; issue 563 conns: make(map[*wsConn]bool), watchReq: make(chan watchReq, buffered), newBlobRecv: make(chan string, buffered), @@ -173,6 +173,7 @@ type wsConn struct { send chan []byte // Buffered channel of outbound messages. sh *Handler + // queries is owned by the wsHub.run goroutine. queries map[string]*watchedQuery // tag -> subscription }