search: fix websocket crash

Fixes #563

Change-Id: Iff04e4a40406ddd391f3c8fc93dcfe0209806ee3
This commit is contained in:
Brad Fitzpatrick 2015-01-19 09:29:19 -08:00
parent 3026631521
commit 5c2ad4eaae
1 changed files with 3 additions and 2 deletions

View File

@ -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
}