
On Thu, Nov 30, 2023 at 06:58:32AM +0000, Zoran BoĆĄnjak wrote:
Thanks for your answer. That makes sense. In particular the fact that there should be no need to read own output.
However, one problem remains. Data format I am working with contains a total-length prefix. That is: 2 bytes of total length somewhere in the header of the message (header is of the fixed length). But the builder does not directly provide length.
I knew you'd eventually ask this question.
So, how do I suppose to effectively encode the message in the form:
msg = header <> chunk1 <> chunk2 <> ...
Take a look at my DNS Stub resolver codec: https://github.com/dnsbase/dnsbase/blob/7f381795d190ff4096095e90c34a5d3a16ef... and its "passLen" function: https://github.com/dnsbase/dnsbase/blob/7f381795d190ff4096095e90c34a5d3a16ef... -- Viktor.