From 09c66db7db7f6298c155352d8636e3af3ad2e72b Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Wed, 19 Aug 2015 23:06:44 +0900 Subject: rpki: fix deadlock bug Same as commit 22b43f7ae7daf381520a529157be4c71c11c2bc8. Signed-off-by: FUJITA Tomonori --- server/rpki.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'server') 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) { -- cgit v1.2.3