From aa7d6aada3ffecb63f15754a5e22f37a99d0e98e Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Thu, 2 Jan 2020 18:23:43 +0000 Subject: [PATCH] fix log streaming --- codec.go | 2 +- grpc.go | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/codec.go b/codec.go index a1d4a65..8de1b8b 100644 --- a/codec.go +++ b/codec.go @@ -180,5 +180,5 @@ func (g *grpcCodec) Close() error { } func (g *grpcCodec) String() string { - return g.c.Name() + return "grpc" } diff --git a/grpc.go b/grpc.go index 11f4863..1113f84 100644 --- a/grpc.go +++ b/grpc.go @@ -248,6 +248,7 @@ func (g *grpcServer) handler(srv interface{}, stream grpc.ServerStream) error { contentType: ct, method: fmt.Sprintf("%s.%s", serviceName, methodName), codec: codec, + stream: true, } response := &rpcResponse{ @@ -385,9 +386,11 @@ func (g *grpcServer) processRequest(stream grpc.ServerStream, service *service, } return status.New(statusCode, statusDesc).Err() } + if err := stream.SendMsg(replyv.Interface()); err != nil { return err } + return status.New(statusCode, statusDesc).Err() } }