From ee300ba7ae9fae4defa902a8ff2426d206a00a99 Mon Sep 17 00:00:00 2001 From: Lukas Bischofberger Date: Thu, 3 Jun 2021 11:30:27 +0200 Subject: 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. --- internal/pkg/zebra/zapi.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/pkg/zebra/zapi.go b/internal/pkg/zebra/zapi.go index 9cc78107..9aafbd8e 100644 --- a/internal/pkg/zebra/zapi.go +++ b/internal/pkg/zebra/zapi.go @@ -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 -- cgit v1.2.3