From 5005b7d52cab885218590103b1ebc07d353d6ef8 Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Thu, 23 Jul 2015 00:08:48 +0900 Subject: server: make mrt rpc request reliable Currently, if a mrt request sender doesn't read from bgpd some time, a message could be dropped. Instead, this makes bgpd keep messages in memory until they are read. Signed-off-by: FUJITA Tomonori --- server/server.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'server') diff --git a/server/server.go b/server/server.go index 0bcc578f..d95d5228 100644 --- a/server/server.go +++ b/server/server.go @@ -1933,10 +1933,15 @@ func (server *BgpServer) handleMrt(grpcReq *GrpcRequest) { select { case <-grpcReq.EndCh: return - case grpcReq.ResponseCh <- result: default: } + m := &broadcastMsg{ + req: grpcReq, + result: result, + } + server.broadcastMsgs = append(server.broadcastMsgs, m) + interval := int64(grpcReq.Data.(uint64)) if interval > 0 { go func() { -- cgit v1.2.3