pespin has uploaded this change for review. ( 
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(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/56/41856/1

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: newchange
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I8f95b3a1cae66d39f7b83a4022880ab390b7715e
Gerrit-Change-Number: 41856
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <[email protected]>

Reply via email to