On Tue Dec 16, 2025 at 3:14 PM JST, Alistair Popple wrote:
> On 2025-12-16 at 13:57 +1100, Alexandre Courbot <[email protected]> wrote...
>> The size of messages' payload is miscalculated, leading to extra data
>> passed to the message handler. While this is not a problem with our
>> current set of commands, others with a variable-length payload may
>> misbehave. Fix this by introducing a method returning the payload size
>> and using it.
>
> The whole inconsistency of the message element struct not including it's 
> header
> fields in the size whilst the rpc struct does has caused endless confusion, 
> this
> looks much better, thanks for fixing!

Indeed. It would be so much simpler if the RPC header just included the
size of its *payload* - because if we have the header to begin with, of
course it is part of the message!

Instead we have to deal with the possibility of a nonsensical length
value if it is shorter than that of the header. Thankfully a saturating
sub always yields a correct behavior, else we would have to return a
`Result`. :/

>
> Reviewed-by: Alistair Popple <[email protected]>

Thanks!

Reply via email to