From 80ee64dbc9857158294f69c3ab17f00d2b7343e0 Mon Sep 17 00:00:00 2001 From: Koichiro IWAO Date: Mon, 27 Aug 2018 15:09:27 +0900 Subject: [PATCH] add some log, fix indent --- src/module-xrdp-sink.c | 11 ++++++++--- src/module-xrdp-source.c | 11 ++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/module-xrdp-sink.c b/src/module-xrdp-sink.c index 1dd11b9..ed78c38 100644 --- a/src/module-xrdp-sink.c +++ b/src/module-xrdp-sink.c @@ -319,9 +319,14 @@ static int data_send(struct userdata *u, pa_memchunk *chunk) { sink_socket = getenv("CHANSRV_PULSE_SINK_SOCKET"); if (sink_socket == NULL || sink_socket[0] == '\0') { - /* usually it doesn't reach here. if the socket name is not given - via environment variable, use hardcoded name as fallback */ - snprintf(sink_socket, bytes, "xrdp_chansrv_audio_out_socket_%d", u->display_num); + pa_log("Could not obtain sink_socket from environment."); + /* usually it doesn't reach here. if the socket name is not given + via environment variable, use hardcoded name as fallback */ + snprintf(sink_socket, bytes, "xrdp_chansrv_audio_out_socket_%d", u->display_num); + } + else + { + pa_log("Obtained sink_socket from environment."); } snprintf(s.sun_path, bytes, "%s/%s", socket_dir, sink_socket); pa_log_debug("trying to connect to %s", s.sun_path); diff --git a/src/module-xrdp-source.c b/src/module-xrdp-source.c index 652a07b..d2a598c 100644 --- a/src/module-xrdp-source.c +++ b/src/module-xrdp-source.c @@ -197,9 +197,14 @@ static int data_get(struct userdata *u, pa_memchunk *chunk) { if (source_socket == NULL || source_socket[0] == '\0') { - /* usually it doesn't reach here. if the socket name is not given - via environment variable, use hardcoded name as fallback */ - snprintf(source_socket, bytes, "xrdp_chansrv_audio_in_socket_%d", u->display_num); + pa_log("Could not obtain source_socket from environment."); + /* usually it doesn't reach here. if the socket name is not given + via environment variable, use hardcoded name as fallback */ + snprintf(source_socket, bytes, "xrdp_chansrv_audio_in_socket_%d", u->display_num); + } + else + { + pa_log("Obtained sink_socket from environment."); } snprintf(s.sun_path, bytes, "%s/%s", socket_dir, source_socket); pa_log_debug("Trying to connect to %s", s.sun_path);