fix log streaming
This commit is contained in:
parent
e697912ee5
commit
225b17559b
@ -180,5 +180,5 @@ func (g *grpcCodec) Close() error {
|
||||
}
|
||||
|
||||
func (g *grpcCodec) String() string {
|
||||
return g.c.Name()
|
||||
return "grpc"
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
@ -346,7 +346,9 @@ func (router *router) readRequest(r Request) (service *service, mtype *methodTyp
|
||||
}
|
||||
// is it a streaming request? then we don't read the body
|
||||
if mtype.stream {
|
||||
cc.ReadBody(nil)
|
||||
if cc.(codec.Codec).String() != "grpc" {
|
||||
cc.ReadBody(nil)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user