diff options
author | Lukas Bischofberger <me@worx.li> | 2021-06-03 11:30:27 +0200 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@gmail.com> | 2021-06-27 15:04:27 +0000 |
commit | ee300ba7ae9fae4defa902a8ff2426d206a00a99 (patch) | |
tree | f3665ee6ca62938459a533661590f5ff262b0f22 /internal/pkg/zebra | |
parent | 0419224a8c744ce0790a6eb3ff87365c4215fcdc (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.
Diffstat (limited to 'internal/pkg/zebra')
-rw-r--r-- | internal/pkg/zebra/zapi.go | 2 |
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 |