zebra: close the incoming channel

In general the writer should close the channel, thus we can close the channel here directly.
If zebra has disconnected the `closeChannel` method will in most cases not even close the channel
because no more messages can be received on it.
This commit is contained in:
Lukas Bischofberger
2021-06-27 15:04:27 +00:00
committed by FUJITA Tomonori
parent 0419224a8c
commit ee300ba7ae
+1 -1
View File
@@ -1377,7 +1377,7 @@ func NewClient(network, address string, typ RouteType, version uint8, software s
// Start receive loop only when the first message successfully received.
go func() {
defer closeChannel(incoming)
defer close(incoming)
for {
if m, err := receiveSingleMsg(); err != nil {
return