pulse: respect XRDP_SOCKET_PATH environment variable
This commit is contained in:
parent
1acef2567c
commit
e1d11a74da
@ -3,10 +3,8 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
# change this to your pulseaudio source directory
|
# change this to your pulseaudio source directory
|
||||||
PULSE_DIR = /home/lk/pulseaudio-1.1
|
PULSE_DIR = /tmp/pulseaudio-10.0
|
||||||
# change this if you're using non-default socket directory
|
CFLAGS = -Wall -O2 -I$(PULSE_DIR) -I$(PULSE_DIR)/src -DHAVE_CONFIG_H -fPIC
|
||||||
SOCK_DIR = /tmp/.xrdp
|
|
||||||
CFLAGS = -Wall -O2 -I$(PULSE_DIR) -I$(PULSE_DIR)/src -DHAVE_CONFIG_H -fPIC -DXRDP_SOCKET_PATH=\"$(SOCK_DIR)\"
|
|
||||||
|
|
||||||
all: module-xrdp-sink.so module-xrdp-source.so
|
all: module-xrdp-sink.so module-xrdp-source.so
|
||||||
|
|
||||||
|
@ -292,6 +292,7 @@ static int lsend(int fd, char *data, int bytes) {
|
|||||||
|
|
||||||
static int data_send(struct userdata *u, pa_memchunk *chunk) {
|
static int data_send(struct userdata *u, pa_memchunk *chunk) {
|
||||||
char *data;
|
char *data;
|
||||||
|
char *socket_dir;
|
||||||
int bytes;
|
int bytes;
|
||||||
int sent;
|
int sent;
|
||||||
int fd;
|
int fd;
|
||||||
@ -308,7 +309,13 @@ static int data_send(struct userdata *u, pa_memchunk *chunk) {
|
|||||||
memset(&s, 0, sizeof(s));
|
memset(&s, 0, sizeof(s));
|
||||||
s.sun_family = AF_UNIX;
|
s.sun_family = AF_UNIX;
|
||||||
bytes = sizeof(s.sun_path) - 1;
|
bytes = sizeof(s.sun_path) - 1;
|
||||||
snprintf(s.sun_path, bytes, CHANSRV_PORT_OUT_STR, u->display_num);
|
socket_dir = getenv("XRDP_SOCKET_PATH");
|
||||||
|
if (socket_dir == NULL || socket_dir[0] == '\0')
|
||||||
|
{
|
||||||
|
socket_dir = "/tmp/.xrdp";
|
||||||
|
}
|
||||||
|
snprintf(s.sun_path, bytes, "%s/" CHANSRV_PORT_OUT_BASE_STR,
|
||||||
|
socket_dir, u->display_num);
|
||||||
pa_log_debug("trying to connect to %s", s.sun_path);
|
pa_log_debug("trying to connect to %s", s.sun_path);
|
||||||
if (connect(fd, (struct sockaddr *)&s,
|
if (connect(fd, (struct sockaddr *)&s,
|
||||||
sizeof(struct sockaddr_un)) != 0) {
|
sizeof(struct sockaddr_un)) != 0) {
|
||||||
|
@ -177,6 +177,7 @@ static int data_get(struct userdata *u, pa_memchunk *chunk) {
|
|||||||
int read_bytes;
|
int read_bytes;
|
||||||
struct sockaddr_un s;
|
struct sockaddr_un s;
|
||||||
char *data;
|
char *data;
|
||||||
|
char *socket_dir;
|
||||||
char buf[11];
|
char buf[11];
|
||||||
unsigned char ubuf[10];
|
unsigned char ubuf[10];
|
||||||
|
|
||||||
@ -186,7 +187,13 @@ static int data_get(struct userdata *u, pa_memchunk *chunk) {
|
|||||||
memset(&s, 0, sizeof(s));
|
memset(&s, 0, sizeof(s));
|
||||||
s.sun_family = AF_UNIX;
|
s.sun_family = AF_UNIX;
|
||||||
bytes = sizeof(s.sun_path) - 1;
|
bytes = sizeof(s.sun_path) - 1;
|
||||||
snprintf(s.sun_path, bytes, CHANSRV_PORT_IN_STR, u->display_num);
|
socket_dir = getenv("XRDP_SOCKET_PATH");
|
||||||
|
if (socket_dir == NULL || socket_dir[0] == '\0')
|
||||||
|
{
|
||||||
|
socket_dir = "/tmp/.xrdp";
|
||||||
|
}
|
||||||
|
snprintf(s.sun_path, bytes, "%s/" CHANSRV_PORT_IN_BASE_STR,
|
||||||
|
socket_dir, u->display_num);
|
||||||
pa_log_debug("Trying to connect to %s", s.sun_path);
|
pa_log_debug("Trying to connect to %s", s.sun_path);
|
||||||
|
|
||||||
if (connect(fd, (struct sockaddr *) &s, sizeof(struct sockaddr_un)) != 0) {
|
if (connect(fd, (struct sockaddr *) &s, sizeof(struct sockaddr_un)) != 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user