summaryrefslogtreecommitdiffhomepage
path: root/server/rpki.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-08-19 23:06:44 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-08-19 23:06:44 +0900
commit09c66db7db7f6298c155352d8636e3af3ad2e72b (patch)
tree88827b77b1d4e5ac37db313648747dc99aa82f85 /server/rpki.go
parentaa9af495182e822b84201e1d708cda7d2d090313 (diff)
rpki: fix deadlock bug
Same as commit 22b43f7ae7daf381520a529157be4c71c11c2bc8. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server/rpki.go')
-rw-r--r--server/rpki.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/server/rpki.go b/server/rpki.go
index 1261b7c8..53a56e04 100644
--- a/server/rpki.go
+++ b/server/rpki.go
@@ -75,15 +75,16 @@ func (c *roaClient) handleRTRMsg(r *roa) {
func (c *roaClient) handleGRPC(grpcReq *GrpcRequest) {
if tree, ok := c.roas[grpcReq.RouteFamily]; ok {
+ results := make([]*GrpcResponse, 0)
tree.Walk(func(s string, v interface{}) bool {
r, _ := v.(*roa)
result := &GrpcResponse{}
result.Data = r.toApiStruct()
- grpcReq.ResponseCh <- result
+ results = append(results, result)
return false
})
+ go sendMultipleResponses(grpcReq, results)
}
- close(grpcReq.ResponseCh)
}
func (c *roaClient) validate(pathList []*table.Path) {