Attention is currently required from: daniel.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/32758 )
Change subject: osmo_io: Improve handling of segmentation_cb ......................................................................
Patch Set 3:
(2 comments)
File include/osmocom/core/osmo_io.h:
https://gerrit.osmocom.org/c/libosmocore/+/32758/comment/31c8f07c_c7fabbc6 PS3, Line 46: * Needs to return the size of the next segment. If it returns
Maybe message? Think of IPA messages over a stream protocol such as TCP. […]
Maybe the initial point here is that I'm not sure why the segmentation callback is needed in osmo_io, to me that's one layer up and should be handled by the user of this API. I'm happy to be enlightened on the matter though.
Maybe the problem is that there's no good documentation in here on what's the purpose of this callback and how it is supposed to be working/implemented.
File src/core/osmo_io.c:
https://gerrit.osmocom.org/c/libosmocore/+/32758/comment/b210fed4_c9ecf3b4 PS3, Line 249: } else if (pending_len < 0) {
No, pending_len is the difference between what was read so far and the necessary size of the next pa […]
ok, maybe the ting here is that you should declare: "pending_len = len - msg_len;"
and then check for "pending_len > 0". It feels really weird having a negative value in there.