Attention is currently required from: arehbein, laforge, pespin.
daniel has posted comments on this change. (
https://gerrit.osmocom.org/c/libosmo-netif/+/33193 )
Change subject: Add osmo_io support to osmo_stream_cli and osmo_stream_srv
......................................................................
Patch Set 10:
(6 comments)
File src/stream.c:
https://gerrit.osmocom.org/c/libosmo-netif/+/33193/comment/5368ac86_5373c2e5
PS7, Line 598: handle_connecting(cli, res);
This split into a separate function you could do it in
a previous separate preparation patch.
Ack
https://gerrit.osmocom.org/c/libosmo-netif/+/33193/comment/6c84d18b_b1b934e3
PS7, Line 620: if (msg && res <= 0) {
EAGAIN would trigger closing the socket?
This
shouldn't happen since osmo_io only writes to the fd if it's writable.
https://gerrit.osmocom.org/c/libosmo-netif/+/33193/comment/bc4afef1_4581ada5
PS7, Line 881: cli->ofd.priv_nr = 0; /* XXX */
what about this XXX?
Done
https://gerrit.osmocom.org/c/libosmo-netif/+/33193/comment/b6c5350a_6c95c2c9
PS7, Line 1046: cli->iofd = osmo_iofd_setup(cli, -1, cli->name,
OSMO_IO_FD_MODE_READ_WRITE, &osmo_stream_cli_ioops, cli);
shouldn't this -1 be "fd"?
The
relevant fd is in osmo_iofd_register(). In the reconnect case when osmo_stream_cli_open is
called cli->iofd will already be set and osmo_iofd_register() registers a new fd.
https://gerrit.osmocom.org/c/libosmo-netif/+/33193/comment/7a08bcd5_9d49e29b
PS7, Line 1540: osmo_stream_srv_destroy(conn);
just wondering whether you may need to return -EBADF
here?
Not in a void function :-)
osmo_stream_srv_destroy() calls osmo_iofd_free() which does the right thing™
It'll close the fd, defer free() until after the callback has returned and not call
the other callback.
https://gerrit.osmocom.org/c/libosmo-netif/+/33193/comment/b6e69d6f_6b476914
PS7, Line 1714: conn->iofd_read_cb = read_cb;
See, these can perfectly be separate setter APIs like
we do for osmo_stream_cli.
I never argued that they couldn't be
--
To view, visit
https://gerrit.osmocom.org/c/libosmo-netif/+/33193
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I2f52c7107c392b6f4b0bf2a84f8c873c084a200c
Gerrit-Change-Number: 33193
Gerrit-PatchSet: 10
Gerrit-Owner: arehbein <arehbein(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: daniel <dwillmann(a)sysmocom.de>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: arehbein <arehbein(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 09 Jun 2023 14:07:20 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment