Attention is currently required from: pespin.
daniel 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/3a5b6023_b113506f
PS3, Line 46: * Needs to return the size of the next segment. If it returns
I'm not sure what "the size of the next
segment" means here.
Maybe message? Think of IPA messages over a stream
protocol such as TCP. We need to find the message boundaries again and the segmentation_cb
returns the size of the next message (as soon as it has enough data to determine that).
File src/core/osmo_io.c:
https://gerrit.osmocom.org/c/libosmocore/+/32758/comment/bb40fb79_0c675e17
PS3, Line 249: } else if (pending_len < 0) {
I think this should be pending_len > 0?
No,
pending_len is the difference between what was read so far and the necessary size of the
next packet.
len (what segmentation_cb() returns) is the expected size of the next packet, msg_len is
the size of what was read so far.
So for IPA and you read 3 bytes:
| 0x00 | 0x03 | 0x00 |
In that case segmentation_cb will return 6 (len in the message is 3 + size of ipa_head).
pending_len = -3 (3 bytes are missing), therefore we need to save the complete msg and
defer handling anything.
--
To view, visit
https://gerrit.osmocom.org/c/libosmocore/+/32758
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I6a0eebb8d4490f09a3cc6eb97d4ff47b4a8fd377
Gerrit-Change-Number: 32758
Gerrit-PatchSet: 3
Gerrit-Owner: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 17 May 2023 23:37:49 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment