summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLukas Bischofberger <me@worx.li>2021-06-03 11:30:27 +0200
committerFUJITA Tomonori <fujita.tomonori@gmail.com>2021-06-27 15:04:27 +0000
commitee300ba7ae9fae4defa902a8ff2426d206a00a99 (patch)
treef3665ee6ca62938459a533661590f5ff262b0f22
parent0419224a8c744ce0790a6eb3ff87365c4215fcdc (diff)
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.
-rw-r--r--internal/pkg/zebra/zapi.go2
1 files changed, 1 insertions, 1 deletions
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