Attention is currently required from: pespin, fixeria, daniel.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/34057 )
Change subject: stream: Split cli/srv specific code out of stream.c
......................................................................
Patch Set 3:
(1 comment)
Patchset:
PS3:
are we sure this re-factoring doesn't clash with ongoing osmo_io work? We should always avoid to do re-structuring on something that's actively being worked on.
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/34057
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I22af01bba2040eb320ba48fd1b46c090c98be159
Gerrit-Change-Number: 34057
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 04 Aug 2023 14:55:26 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/34074 )
Change subject: stream: Append data to current tail of message upon recv()
......................................................................
stream: Append data to current tail of message upon recv()
The previous behavior was not standarized, and even erratic under some
code paths (passing msgb_data() and size=msgb_tailroom()).
This patch standarizes the behavior, and makes it possible to append
content if the user wishes so instead of erasing old data in the msgb
passed to it.
Change-Id: I2cfcd4f61545e6a76d84495c3467999efccf22df
---
M src/stream_cli.c
M src/stream_srv.c
2 files changed, 21 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/74/34074/1
diff --git a/src/stream_cli.c b/src/stream_cli.c
index 9845f14..0e075b8 100644
--- a/src/stream_cli.c
+++ b/src/stream_cli.c
@@ -917,7 +917,7 @@
OSMO_ASSERT(cli);
OSMO_ASSERT(msg);
- ret = recv(cli->ofd.fd, msg->data, msg->data_len, 0);
+ ret = recv(cli->ofd.fd, msg->tail, msgb_tailroom(msg), 0);
if (ret < 0) {
if (errno == EPIPE || errno == ECONNRESET)
LOGSCLI(cli, LOGL_ERROR, "lost connection with srv\n");
diff --git a/src/stream_srv.c b/src/stream_srv.c
index 4d8d4d3..be43a80 100644
--- a/src/stream_srv.c
+++ b/src/stream_srv.c
@@ -826,14 +826,15 @@
struct sctp_sndrcvinfo sinfo;
int flags = 0;
int ret;
+ uint8_t *data = msg->tail;
- ret = sctp_recvmsg(fd, msgb_data(msg), msgb_tailroom(msg),
+ ret = sctp_recvmsg(fd, data, msgb_tailroom(msg),
NULL, NULL, &sinfo, &flags);
msgb_sctp_msg_flags(msg) = 0;
msgb_sctp_ppid(msg) = ntohl(sinfo.sinfo_ppid);
msgb_sctp_stream(msg) = sinfo.sinfo_stream;
if (flags & MSG_NOTIFICATION) {
- union sctp_notification *notif = (union sctp_notification *)msgb_data(msg);
+ union sctp_notification *notif = (union sctp_notification *)data;
LOGP(DLINP, LOGL_DEBUG, "NOTIFICATION %u flags=0x%x\n", notif->sn_header.sn_type, notif->sn_header.sn_flags);
msgb_put(msg, sizeof(union sctp_notification));
msgb_sctp_msg_flags(msg) = OSMO_STREAM_SCTP_MSG_FLAGS_NOTIFICATION;
@@ -908,7 +909,7 @@
switch (conn->srv->sk_domain) {
case AF_UNIX:
- ret = recv(conn->ofd.fd, msgb_data(msg), msgb_tailroom(msg), 0);
+ ret = recv(conn->ofd.fd, msg->tail, msgb_tailroom(msg), 0);
break;
case AF_INET:
case AF_INET6:
@@ -921,7 +922,7 @@
#endif
case IPPROTO_TCP:
default:
- ret = recv(conn->ofd.fd, msgb_data(msg), msgb_tailroom(msg), 0);
+ ret = recv(conn->ofd.fd, msg->tail, msgb_tailroom(msg), 0);
break;
}
break;
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/34074
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I2cfcd4f61545e6a76d84495c3467999efccf22df
Gerrit-Change-Number: 34074
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange
Attention is currently required from: pespin.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmo-netif/+/34070
to look at the new patch set (#2).
Change subject: stream_cli: Increase log level of established conn to INFO
......................................................................
stream_cli: Increase log level of established conn to INFO
Change-Id: I49776db0b12ee46b629381d2fa2b501c2a63e390
---
M src/stream_cli.c
M tests/stream/stream_test.err
2 files changed, 13 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/70/34070/2
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/34070
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I49776db0b12ee46b629381d2fa2b501c2a63e390
Gerrit-Change-Number: 34070
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: fixeria.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/34057 )
Change subject: stream: Split cli/srv specific code out of stream.c
......................................................................
Patch Set 3:
(1 comment)
Patchset:
PS3:
Sorry I messed it up in revision 2 of the patch, I squashed some WIP stuff into it. It should be fixed in revision 3.
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/34057
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I22af01bba2040eb320ba48fd1b46c090c98be159
Gerrit-Change-Number: 34057
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 04 Aug 2023 11:30:00 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: pespin, fixeria.
Hello osmith, Jenkins Builder, fixeria,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmo-netif/+/34057
to look at the new patch set (#3).
Change subject: stream: Split cli/srv specific code out of stream.c
......................................................................
stream: Split cli/srv specific code out of stream.c
The dev/user in general is only interested about one side of the stream
when looking at the code. Since the stream.c file is tarting to be quite
large/bloated, this patch splits its content into stream_cli.c and
stream_srv.c to make it easier to improve/extend and review.
Keep common code between cli and srv in stream.c, and add a private header
to contain references to it.
Change-Id: I22af01bba2040eb320ba48fd1b46c090c98be159
---
M include/osmocom/netif/Makefile.am
A include/osmocom/netif/stream_private.h
M src/Makefile.am
M src/stream.c
A src/stream_cli.c
A src/stream_srv.c
6 files changed, 1,954 insertions(+), 1,786 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/57/34057/3
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/34057
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I22af01bba2040eb320ba48fd1b46c090c98be159
Gerrit-Change-Number: 34057
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newpatchset