You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to grpc.io
How can the C++ server detect the compression algorithm of the client (request)?
There are two contexts: `grpc::ServerContext` and `grpc::ClientContext`. Each context has methods: `compression_algorithm` (getter) and `set_compression_algorithm`.
If the client sets algo by `set_compression_algorithm` it used to compress requests. If the server sets algo by `set_compression_algorithm` it used to compress responses ([docs][1]). But how to check algo of the request on the server side?
`set_compression_algorithm` [adds metadata][2] in the header `grpc-internal-encoding-request`. But it is a internal metadata and this is not available in `grpc::ServerContext::client_metadata`
Generally, I want to get compress algo of a client on the server side and set the same algo for responses.