Attention is currently required from: laforge, daniel, lynxis lazus.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/30936 )
Change subject: gpsr_ns2_udp: Use osmo_io_fd instead of osmo_fd ......................................................................
Patch Set 7:
(4 comments)
File src/gb/gprs_ns2_udp.c:
https://gerrit.osmocom.org/c/libosmocore/+/30936/comment/ba16a572_be039c3f PS4, Line 183: struct osmo_sockaddr *saddr)
wrong indentation
Done
https://gerrit.osmocom.org/c/libosmocore/+/30936/comment/b4638660_a5c6cf04 PS4, Line 225: static void handle_nsip_sendmsg(struct osmo_io_fd *iofd, int res, struct msgb *msg)
if this is not needed, then pass a NULL pointer instead of this function?
Answering myself here: the library code unconditionally calls the callback function, because the app is expected to want to have a callback set to be able to check the return code of the write operation done by the library (available in "res" param here).
https://gerrit.osmocom.org/c/libosmocore/+/30936/comment/7ece2bf4_66e9701e PS4, Line 272: .sendmsg_cb = &handle_nsip_sendmsg,
= NULL
See my other comment.
File src/gb/gprs_ns2_udp.c:
https://gerrit.osmocom.org/c/libosmocore/+/30936/comment/1143b62d_f688cba3 PS6, Line 72: if (priv->iofd) : osmo_iofd_free(priv->iofd);
ACK, in the new patchset osmo_iofd_free() can handle a call with NULL.
I'm adding this NULL check myself in the new version of the other patch I'm submitting now.