From c0b4a5943a5157f0de2e7b03827f714db704922e Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Sat, 27 Jun 2015 17:51:44 +0900 Subject: server: use ToApiStruct() to get api structure Signed-off-by: ISHIDA Wataru --- server/server.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/server/server.go b/server/server.go index b77f24b1..c9425836 100644 --- a/server/server.go +++ b/server/server.go @@ -16,7 +16,6 @@ package server import ( - "encoding/json" "fmt" log "github.com/Sirupsen/logrus" "github.com/osrg/gobgp/api" @@ -898,14 +897,7 @@ func (server *BgpServer) handleGrpc(grpcReq *GrpcRequest) []*SenderMsg { for _, p := range paths { result := &GrpcResponse{} - path := &api.Path{} - j, _ := json.Marshal(p) - err := json.Unmarshal(j, path) - if err != nil { - result.ResponseErr = err - } else { - result.Data = path - } + result.Data = p.ToApiStruct() grpcReq.ResponseCh <- result } close(grpcReq.ResponseCh) -- cgit v1.2.3