diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-06-10 08:03:18 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-06-10 09:31:43 +0900 |
commit | f2f6a230ac300f3ca9b774e0f0e52bf36655fb9e (patch) | |
tree | 875ae4693c00c8bc5c5375c494ff4123785728e1 /server/fsm.go | |
parent | 794289f118b717f1931b5ac811430d37e3531a26 (diff) |
server: clean up sendMessageloop
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server/fsm.go')
-rw-r--r-- | server/fsm.go | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/server/fsm.go b/server/fsm.go index 2ebe8047..b40305f6 100644 --- a/server/fsm.go +++ b/server/fsm.go @@ -729,19 +729,14 @@ func (h *FSMHandler) sendMessageloop() error { } return nil case m := <-h.outgoing: - err := send(m) - if err != nil { + if err := send(m); err != nil { return nil } case <-fsm.keepaliveTicker.C: - m := bgp.NewBGPKeepAliveMessage() - b, _ := m.Serialize() - _, err := conn.Write(b) - if err != nil { - h.errorCh <- true + if err := send(bgp.NewBGPKeepAliveMessage()); err != nil { return nil } - fsm.bgpMessageStateUpdate(m.Header.Type, false) + } } } |