# HG changeset patch # User Mikael Berthe # Date 1494268289 -7200 # Node ID 7a4604bb12d93f827de2737bee138638803aae1d # Parent 84ad56b643c8b2545a4ec45908b59d64df58e550 Fix panic when a streaming connection is closed (in multi-streams) tagDone channels were not initialized for multiple tags streams. diff -r 84ad56b643c8 -r 7a4604bb12d9 cmd/stream.go --- a/cmd/stream.go Mon May 08 12:17:59 2017 +0200 +++ b/cmd/stream.go Mon May 08 20:31:29 2017 +0200 @@ -115,6 +115,7 @@ errPrint("Launching listener for tag '%s'", t) } tagEvCh[i] = make(chan madon.StreamEvent) + tagDoneCh[i] = make(chan bool) e := gClient.StreamListener(streamName, t, tagEvCh[i], stop, tagDoneCh[i]) if e != nil { if i > 0 { // Close previous connections @@ -157,8 +158,8 @@ LISTEN: for { select { - case _, ok := <-done: - if !ok { // done is closed, end of streaming + case v, ok := <-done: + if !ok || v == true { // done is closed, end of streaming break LISTEN } case ev := <-evChan: