Attention is currently required from: msuraev.
neels has posted comments on this change. (
https://gerrit.osmocom.org/c/libosmocore/+/28993 )
Change subject: Use osmo_sockaddr_strs_to_str() for multiaddr helper
......................................................................
Patch Set 8: Code-Review-1
(3 comments)
Patchset:
PS8:
the code added in
https://gerrit.osmocom.org/c/libosmocore/+/28992 should move to this
function, as indicated below
File src/socket.c:
https://gerrit.osmocom.org/c/libosmocore/+/28993/comment/dda0b532_5a697daa
PS8, Line 208: * buf_len >= 2: (hostA|hostB|...|...)
(this doc is wrong)
https://gerrit.osmocom.org/c/libosmocore/+/28993/comment/16eeb34d_42c05fa7
PS8, Line 211: {
if you use an implementation like this here, we don't need to add
osmo_sockaddr_strs_to_str() at all and save a lot of dynamic allocations:
struct osmo_strbuf sb = { ... };
if (i != 1)
OSMO_STRBUF_PRINTF(sb, "(");
for (...) {
struct osmo_sockaddr_str ss;
if (i)
OSMO_STRBUF_PRINTF(sb, "|");
osmo_sockaddr_str_from_str2(&ss, hosts[i]);
OSMO_STRBUF_PRINTF(sb, OSMO_SOCKADDR_STR_FMT, OSMO_SOCKADDR_STR_FMT_ARGS(&ss));
}
if (i != 1)
OSMO_STRBUF_PRINTF(sb, ")");
return sb.chars_needed;
--
To view, visit
https://gerrit.osmocom.org/c/libosmocore/+/28993
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Icef53fe4b6e51563d97a1bc48001d67679b3b6e9
Gerrit-Change-Number: 28993
Gerrit-PatchSet: 8
Gerrit-Owner: msuraev <msuraev(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: msuraev <msuraev(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 17 Aug 2022 00:48:15 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment