summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-06-27 17:51:44 +0900
committerISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-07-01 10:58:01 +0900
commitc0b4a5943a5157f0de2e7b03827f714db704922e (patch)
tree014dc9cf25a8d9f51b2c88bf4ecfb148522daf7d
parenta0c14ca606b6567835a4d50c4b457c036df2cda9 (diff)
server: use ToApiStruct() to get api structure
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
-rw-r--r--server/server.go10
1 files changed, 1 insertions, 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)