pespin has uploaded this change for review. (
https://gerrit.osmocom.org/c/libosmo-netif/+/30719 )
Change subject: stream: osmo_stream_*_write: Unifiy way to get data and length
......................................................................
stream: osmo_stream_*_write: Unifiy way to get data and length
Change-Id: I5b5d6f7a5a1722bd01c13d32557c21d8a0889966
---
M src/stream.c
1 file changed, 6 insertions(+), 6 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/19/30719/1
diff --git a/src/stream.c b/src/stream.c
index b784b21..e9860c3 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -355,7 +355,7 @@
switch (cli->sk_domain) {
case AF_UNIX:
- ret = send(cli->ofd.fd, msg->data, msg->len, 0);
+ ret = send(cli->ofd.fd, msgb_data(msg), msgb_length(msg), 0);
break;
case AF_UNSPEC:
case AF_INET:
@@ -366,13 +366,13 @@
memset(&sinfo, 0, sizeof(sinfo));
sinfo.sinfo_ppid = htonl(msgb_sctp_ppid(msg));
sinfo.sinfo_stream = msgb_sctp_stream(msg);
- ret = sctp_send(cli->ofd.fd, msg->data, msgb_length(msg),
+ ret = sctp_send(cli->ofd.fd, msgb_data(msg), msgb_length(msg),
&sinfo, MSG_NOSIGNAL);
break;
#endif
case IPPROTO_TCP:
default:
- ret = send(cli->ofd.fd, msg->data, msgb_length(msg), 0);
+ ret = send(cli->ofd.fd, msgb_data(msg), msgb_length(msg), 0);
break;
}
break;
@@ -1317,7 +1317,7 @@
switch (conn->srv->sk_domain) {
case AF_UNIX:
- ret = send(conn->ofd.fd, msg->data, msg->len, 0);
+ ret = send(conn->ofd.fd, msgb_data(msg), msgb_length(msg), 0);
break;
case AF_INET:
case AF_INET6:
@@ -1328,13 +1328,13 @@
memset(&sinfo, 0, sizeof(sinfo));
sinfo.sinfo_ppid = htonl(msgb_sctp_ppid(msg));
sinfo.sinfo_stream = msgb_sctp_stream(msg);
- ret = sctp_send(conn->ofd.fd, msg->data, msgb_length(msg),
+ ret = sctp_send(conn->ofd.fd, msgb_data(msg), msgb_length(msg),
&sinfo, MSG_NOSIGNAL);
break;
#endif
case IPPROTO_TCP:
default:
- ret = send(conn->ofd.fd, msg->data, msg->len, 0);
+ ret = send(conn->ofd.fd, msgb_data(msg), msgb_length(msg), 0);
break;
}
break;
--
To view, visit
https://gerrit.osmocom.org/c/libosmo-netif/+/30719
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I5b5d6f7a5a1722bd01c13d32557c21d8a0889966
Gerrit-Change-Number: 30719
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange