semlanik/qtprotobuf

Make possible to limit the size of the incomming/outgoing messages.

Opened this issue · 0 comments

Problem description
Following the question raised in #209 I found out that the reference implementation of gRPC currently has the message size limits. This also should be implemented in QtGrpc as the channel options(I think everyone could agree that it should be a session-specific option)

Suggestion/solution

  • Add the following methods to the QAbstractGrpcChannel interface:
void setMaxSendMessageSize(int size);
void setMaxRecvMessageSize(int size);
  • Check the maximum message size before actually send it or after receiving the incoming message and trigger a channel-based error if the message doesn't fit the limits.

Alternatives
N/A

Additional context
There should be another task that will require breaking the outgoing messages that are bigger than MAX_UINT32 into chunks when sending over HTTP2 channel. It's necessary since the grcp message size "header" is only 4 bytes length.