summaryrefslogtreecommitdiffstats
path: root/sesman
diff options
context:
space:
mode:
authorJay Sorg <jay.sorg@gmail.com>2013-08-17 13:32:53 -0700
committerJay Sorg <jay.sorg@gmail.com>2013-08-17 13:32:53 -0700
commite602a28d5c7548ec0a6f5a7a3b217ecd43c29eac (patch)
treebe8220ba7c782bccf22755ecea38e2a2197edb9d /sesman
parentee98f1cdd4baf69f5c3620b1dfe1d59256ca443a (diff)
downloadxrdp-proprietary-e602a28d5c7548ec0a6f5a7a3b217ecd43c29eac.tar.gz
xrdp-proprietary-e602a28d5c7548ec0a6f5a7a3b217ecd43c29eac.zip
common: transport aware when app is terminating
Diffstat (limited to 'sesman')
-rw-r--r--sesman/chansrv/chansrv.c14
-rw-r--r--sesman/chansrv/chansrv.h3
-rw-r--r--sesman/chansrv/smartcard_pcsc.c4
-rw-r--r--sesman/chansrv/sound.c3
4 files changed, 20 insertions, 4 deletions
diff --git a/sesman/chansrv/chansrv.c b/sesman/chansrv/chansrv.c
index 388d0273..26d4182e 100644
--- a/sesman/chansrv/chansrv.c
+++ b/sesman/chansrv/chansrv.c
@@ -77,6 +77,13 @@ int g_exec_pid = 0;
tui32 g_dvc_chan_id = 100;
/*****************************************************************************/
+int DEFAULT_CC
+g_is_term(void)
+{
+ return g_is_wait_obj_set(g_term_event);
+}
+
+/*****************************************************************************/
/* add data to chan_item, on its way to the client */
/* returns error */
static int APP_CC
@@ -844,13 +851,15 @@ setup_listen(void)
if (g_use_unix_socket)
{
- g_lis_trans = trans_create(2, 8192, 8192);
+ g_lis_trans = trans_create(TRANS_MODE_UNIX, 8192, 8192);
+ g_lis_trans->is_term = g_is_term;
g_snprintf(port, 255, "/tmp/.xrdp/xrdp_chansrv_socket_%d",
7200 + g_display_num);
}
else
{
- g_lis_trans = trans_create(1, 8192, 8192);
+ g_lis_trans = trans_create(TRANS_MODE_TCP, 8192, 8192);
+ g_lis_trans->is_term = g_is_term;
g_snprintf(port, 255, "%d", 7200 + g_display_num);
}
@@ -875,6 +884,7 @@ setup_api_listen(void)
int error = 0;
g_api_lis_trans = trans_create(TRANS_MODE_UNIX, 8192 * 4, 8192 * 4);
+ g_api_lis_trans->is_term = g_is_term;
g_snprintf(port, 255, "/tmp/.xrdp/xrdpapi_%d", g_display_num);
g_api_lis_trans->trans_conn_in = my_api_trans_conn_in;
error = trans_listen(g_api_lis_trans, port);
diff --git a/sesman/chansrv/chansrv.h b/sesman/chansrv/chansrv.h
index bca30ca4..12162dd1 100644
--- a/sesman/chansrv/chansrv.h
+++ b/sesman/chansrv/chansrv.h
@@ -54,6 +54,9 @@ struct xrdp_api_data
int is_connected;
};
+int DEFAULT_CC
+g_is_term(void);
+
int APP_CC send_channel_data(int chan_id, char *data, int size);
int APP_CC main_cleanup(void);
int APP_CC find_empty_slot_in_dvc_channels();
diff --git a/sesman/chansrv/smartcard_pcsc.c b/sesman/chansrv/smartcard_pcsc.c
index a3a269d7..909c7df3 100644
--- a/sesman/chansrv/smartcard_pcsc.c
+++ b/sesman/chansrv/smartcard_pcsc.c
@@ -24,6 +24,7 @@
#define PCSC_STANDIN 1
+#include "chansrv.h"
#include "os_calls.h"
#include "smartcard.h"
#include "log.h"
@@ -258,7 +259,8 @@ scard_pcsc_init(void)
if (g_lis == 0)
{
- g_lis = trans_create(2, 8192, 8192);
+ g_lis = trans_create(TRANS_MODE_UNIX, 8192, 8192);
+ g_lis->is_term = g_is_term;
g_snprintf(g_pcsc_directory, 255, "/tmp/.xrdp/pcsc%d", g_display_num);
if (g_directory_exist(g_pcsc_directory))
{
diff --git a/sesman/chansrv/sound.c b/sesman/chansrv/sound.c
index 9ee3c8c3..2e85f1f2 100644
--- a/sesman/chansrv/sound.c
+++ b/sesman/chansrv/sound.c
@@ -551,7 +551,8 @@ sound_init(void)
LOG(0, ("sound_init:"));
sound_send_server_formats();
- g_audio_l_trans = trans_create(2, 128 * 1024, 8192);
+ g_audio_l_trans = trans_create(TRANS_MODE_UNIX, 128 * 1024, 8192);
+ g_audio_l_trans->is_term = g_is_term;
g_snprintf(port, 255, CHANSRV_PORT_STR, g_display_num);
g_audio_l_trans->trans_conn_in = sound_trans_audio_conn_in;
error = trans_listen(g_audio_l_trans, port);