Attention is currently required from: jolly.
pespin has posted comments on this change by jolly. ( https://gerrit.osmocom.org/c/libosmocore/+/40584?usp=email )
Change subject: osmo-io: Append received message to pending message segment ......................................................................
Patch Set 1: Code-Review-1
(2 comments)
Commit Message:
https://gerrit.osmocom.org/c/libosmocore/+/40584/comment/035600be_08802272?u... : PS1, Line 9: If there is pending data of an incomplete segmented message, received Would you mind rewriting this? The way it is written makes it not really clear what the previous state was, what the patch changes, etc.
Specially since you say some stuff will be done in a later patch. So I'm not sure if you are breaking previously working stuff or what.
File src/core/osmo_io.c:
https://gerrit.osmocom.org/c/libosmocore/+/40584/comment/436bb2b9_175cb01d?u... : PS1, Line 303: msg_pending = iofd_msgb_alloc2(iofd, extra_len); afaiu this is wrong. You are confusing the received_len with the size of the msgb.
What you'd want to pass here is, in the event that "expected_len > iofd->msgb_alloc.size" (which shouldn't happen imho, and in that case it would be a bug of the user of osmo_iodf when configuring it based on protocol expectancies):
iofd_msgb_alloc2(iofd, expected_len - iofd->msgb_alloc.size);
In any case, this would also break the assumption on the user that the msgbs obtained are of a certain configured length.