mirror of
https://github.com/osrg/gobgp.git
synced 2024-05-11 05:55:10 +00:00
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:
committed by
FUJITA Tomonori
parent
0419224a8c
commit
ee300ba7ae
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user