aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2024-03-14 23:07:34 +0100
committerHarald Welte <laforge@osmocom.org>2024-03-15 14:13:32 +0100
commit104265733f7ec898fe139b4539b65a7ee3c1c211 (patch)
tree394942933e7cc4b29ec2ee45c1517df15683804d
parent409ddb74daf124f7aa2295ea9c1d030321962ac5 (diff)
Ensure osmo_stream_{cli,srv}_recv() is used only in osmo_fd mode
The osmo_stream_{cli,srv}_recv() is only for osmo_fd mode users; in case osmo_io mode is used, the read_cb is called with pre-filled message buffers; no need to recv/read directly anymore. Change-Id: Ie96cf1241b2ba4e0a7dda584182d18cad2b4f061
-rw-r--r--src/stream_cli.c1
-rw-r--r--src/stream_srv.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/stream_cli.c b/src/stream_cli.c
index 9c3f65a..f19bf98 100644
--- a/src/stream_cli.c
+++ b/src/stream_cli.c
@@ -1054,6 +1054,7 @@ int osmo_stream_cli_recv(struct osmo_stream_cli *cli, struct msgb *msg)
int ret;
OSMO_ASSERT(cli);
OSMO_ASSERT(msg);
+ OSMO_ASSERT(cli->mode == OSMO_STREAM_MODE_OSMO_FD);
switch (cli->sk_domain) {
case AF_UNIX:
diff --git a/src/stream_srv.c b/src/stream_srv.c
index 58ed7ef..b53caab 100644
--- a/src/stream_srv.c
+++ b/src/stream_srv.c
@@ -1073,6 +1073,7 @@ int osmo_stream_srv_recv(struct osmo_stream_srv *conn, struct msgb *msg)
int ret;
OSMO_ASSERT(conn);
OSMO_ASSERT(msg);
+ OSMO_ASSERT(conn->mode == OSMO_STREAM_MODE_OSMO_FD);
switch (conn->srv->sk_domain) {
case AF_UNIX: