summaryrefslogtreecommitdiffhomepage
path: root/server/server.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-07-23 00:08:48 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-07-23 00:08:48 +0900
commit5005b7d52cab885218590103b1ebc07d353d6ef8 (patch)
tree85924bf49390816ea24d08ef1049311bbd2e8ad8 /server/server.go
parentcfaa537b8301e5f846839021fd355ab7390b12ff (diff)
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 <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server/server.go')
-rw-r--r--server/server.go7
1 files changed, 6 insertions, 1 deletions
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() {