mirror of
https://github.com/osrg/gobgp.git
synced 2024-05-11 05:55:10 +00:00
server: clean up recvMessageWithError
better way to avoid blocked on channel. Signed-off-by: FUJITA Tomonori <[email protected]>
This commit is contained in:
+3
-2
@@ -645,8 +645,9 @@ func (h *FSMHandler) recvMessageWithError() (*FsmMsg, error) {
|
||||
// if the lenght of h.holdTimerResetCh
|
||||
// isn't zero, the timer will be reset
|
||||
// soon anyway.
|
||||
if len(h.holdTimerResetCh) == 0 {
|
||||
h.holdTimerResetCh <- true
|
||||
select {
|
||||
case h.holdTimerResetCh <- true:
|
||||
default:
|
||||
}
|
||||
if m.Header.Type == bgp.BGP_MSG_KEEPALIVE {
|
||||
return nil, nil
|
||||
|
||||
Reference in New Issue
Block a user