pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmo-netif/+/41856?usp=email )

Change subject: stream_srv: keep sockname in iofd name if a stream name is 
explicitly set
......................................................................

stream_srv: keep sockname in iofd name if a stream name is explicitly set

This matches with how we log in eg. LOGSRV() macro. In essence, the user
doesn't need to care about requesting to log the sockname, that's
internally done in all cases. Instead, the stream set_name() is used to
log more upper-layer information.

Change-Id: I8f95b3a1cae66d39f7b83a4022880ab390b7715e
---
M src/stream_srv.c
1 file changed, 5 insertions(+), 2 deletions(-)

Approvals:
  fixeria: Looks good to me, but someone else must approve
  Jenkins Builder: Verified
  osmith: Looks good to me, approved




diff --git a/src/stream_srv.c b/src/stream_srv.c
index d6d4e2d..3abc55a 100644
--- a/src/stream_srv.c
+++ b/src/stream_srv.c
@@ -1103,8 +1103,11 @@
                talloc_free((void *)conn->name);
        conn->name = name;

-       if (conn->mode == OSMO_STREAM_MODE_OSMO_IO && conn->iofd)
-               osmo_iofd_set_name(conn->iofd, conn->name);
+       if (conn->mode == OSMO_STREAM_MODE_OSMO_IO && conn->iofd) {
+               char *tmp = talloc_asprintf(conn, "%s,%s", conn->name, 
conn->sockname);
+               osmo_iofd_set_name(conn->iofd, tmp);
+               talloc_free(tmp);
+       }
 }

 /*! Retrieve name previously set on the srv object (see 
osmo_stream_srv_set_name()).

--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/41856?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I8f95b3a1cae66d39f7b83a4022880ab390b7715e
Gerrit-Change-Number: 41856
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: osmith <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>

Reply via email to