The workflow of using fossa as a JSON RPC server as per the example requires the creation of a buffer for the response to be filled into:
https://github.com/cesanta/fossa/blob/master/examples/json_rpc_server/json_rpc_server.c#L36
The problem here is that the size of a response can be really huge or really small depending on the method called or even the parameters passed to the same method. Pro-actively allocating a large buffer can be a needless waste of memory whereas allocating a small buffer can lead to buffer overflows.
Is there a way around this?