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: Avoid reusing pending buffer; append incoming data instead ......................................................................
Patch Set 3:
(5 comments)
Commit Message:
https://gerrit.osmocom.org/c/libosmocore/+/40584/comment/0f6c0276_c46f912e?u... : PS3, Line 17: This change ensures that newly received data is appended to the existing First you say we don't want to reuse the pending buffer, but here you say "This change ensures that newly received data is appended to the existing pending buffer", which seems to be the opposite of what you first stated?
File src/core/osmo_io.c:
https://gerrit.osmocom.org/c/libosmocore/+/40584/comment/d76babb4_0c35e494?u... : PS3, Line 177: /*! convenience wrapper to call msgb_alloc with parameters from osmo_io_fd (with extra size) */ "with extra size" here doesn't apply anymore?
https://gerrit.osmocom.org/c/libosmocore/+/40584/comment/30485a7d_e24dd494?u... : PS3, Line 178: struct msgb *iofd_msgb_alloc2(struct osmo_io_fd *iofd, size_t size) This is probably breaking the promise that msgb passed to the app are at least of a certain size configured by the user.
https://gerrit.osmocom.org/c/libosmocore/+/40584/comment/a19b37dd_247f0cc8?u... : PS3, Line 335: * If the pending message is not large enough, create a larger message. */ I may be wrong, but I'd expect user to configure iofd with a max_size big enough to allow whatever size is needed?
https://gerrit.osmocom.org/c/libosmocore/+/40584/comment/fa6c86b2_162a97d0?u... : PS3, Line 344: memcpy(msgb_put(iofd->pending, msgb_length(msg)), msgb_data(msg), msgb_length(msg)); Can we avoid 2 memcpys (here and above) in the specific code path?