Tonic reports invalid flag err but it's not

I'm trying to send a dynamic gRPC message by using rust-protobuf and tonic. Here's my attempt. It's almost there, but with an odd error.
To use it, start the server first, then the client.
And we will see the following output:

request: {"name": "World"}
reply: {"message": "Hello World!"}
    Status {
        code: Internal,
        message: "protocol error: received message with invalid compression flag: 10 (valid flags are 0 and 1) while receiving response with status: 200 OK",
        source: None,

It says "invalid compression flag". Alright, let's get the packet:

and... I'm lost here.

I've been debugging it for a while. It seems like the Err is returned here:

it will jump to:


and we got the "invalid compression flag" here:


It seems like the error arises when tonic try to fetch the trailers and clear the body. But it's not the correct body?

Problem solved. In case if anyone interested in, here's the context.


This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.