summaryrefslogtreecommitdiffhomepage
path: root/server/grpc_server.go
diff options
context:
space:
mode:
Diffstat (limited to 'server/grpc_server.go')
-rw-r--r--server/grpc_server.go15
1 files changed, 6 insertions, 9 deletions
diff --git a/server/grpc_server.go b/server/grpc_server.go
index ef850dbf..b14845b2 100644
--- a/server/grpc_server.go
+++ b/server/grpc_server.go
@@ -256,7 +256,7 @@ func (s *Server) ModPath(stream api.Grpc_ModPathServer) error {
arg, err := stream.Recv()
if err == io.EOF {
- return nil
+ break
} else if err != nil {
return err
}
@@ -282,15 +282,12 @@ func (s *Server) ModPath(stream api.Grpc_ModPathServer) error {
log.Debug(err.Error())
return err
}
-
- err = stream.Send(&api.Error{
- Code: api.Error_SUCCESS,
- })
-
- if err != nil {
- return err
- }
}
+ err := stream.SendAndClose(&api.Error{
+ Code: api.Error_SUCCESS,
+ })
+
+ return err
}
func (s *Server) GetNeighborPolicy(ctx context.Context, arg *api.Arguments) (*api.ApplyPolicy, error) {