summaryrefslogtreecommitdiffstats
path: root/sesman
diff options
context:
space:
mode:
authorLaxmikant Rashinkar <LK.Rashinkar@gmail.com>2013-06-27 17:49:10 -0700
committerLaxmikant Rashinkar <LK.Rashinkar@gmail.com>2013-06-27 17:49:10 -0700
commite75767e4dd02bddc37ea939b74071a4e710b41b9 (patch)
tree87b565f6a93c57f2bd8d28f5b01fb6611651cd17 /sesman
parent6d3a2cd5fd6ef933159f0d79d7361c6d7434c2e9 (diff)
parentb1389eac9940c710ff9c892fe4593f02635164ec (diff)
downloadxrdp-proprietary-e75767e4dd02bddc37ea939b74071a4e710b41b9.tar.gz
xrdp-proprietary-e75767e4dd02bddc37ea939b74071a4e710b41b9.zip
Merge branch 'master' of github.com:neutrinolabs/xrdp
Diffstat (limited to 'sesman')
-rw-r--r--sesman/chansrv/chansrv.c23
-rw-r--r--sesman/chansrv/clipboard.c8
-rw-r--r--sesman/chansrv/sound.c1
-rw-r--r--sesman/sesman.c5
4 files changed, 35 insertions, 2 deletions
diff --git a/sesman/chansrv/chansrv.c b/sesman/chansrv/chansrv.c
index 0f7ff042..bd9c27c5 100644
--- a/sesman/chansrv/chansrv.c
+++ b/sesman/chansrv/chansrv.c
@@ -314,6 +314,8 @@ process_message_channel_setup(struct stream *s)
int index;
int rv;
struct chan_item *ci;
+ struct chan_out_data *cod;
+ struct chan_out_data *old_cod;
g_num_chan_items = 0;
g_cliprdr_index = -1;
@@ -336,6 +338,25 @@ process_message_channel_setup(struct stream *s)
g_memset(ci->name, 0, sizeof(ci->name));
in_uint8a(s, ci->name, 8);
in_uint16_le(s, ci->id);
+ /* there might be leftover data from last session after reconnecting
+ so free it */
+ if (ci->head != 0)
+ {
+ cod = ci->head;
+ while (1)
+ {
+ free_stream(cod->s);
+ old_cod = cod;
+ cod = cod->next;
+ g_free(old_cod);
+ if (ci->tail == old_cod)
+ {
+ break;
+ }
+ }
+ }
+ ci->head = 0;
+ ci->tail = 0;
in_uint16_le(s, ci->flags);
LOGM((LOG_LEVEL_DEBUG, "process_message_channel_setup: chan name '%s' "
"id %d flags %8.8x", ci->name, ci->id, ci->flags));
@@ -386,6 +407,8 @@ process_message_channel_setup(struct stream *s)
if (g_rdpsnd_index >= 0)
{
+ /* gets reset to 1 by next send_data_from_chan_item */
+ g_sent = 0; /* wait for response! */
sound_init();
}
diff --git a/sesman/chansrv/clipboard.c b/sesman/chansrv/clipboard.c
index 27c45fff..89dbdbbb 100644
--- a/sesman/chansrv/clipboard.c
+++ b/sesman/chansrv/clipboard.c
@@ -1490,6 +1490,14 @@ clipboard_data_in(struct stream *s, int chan_id, int chan_flags, int length,
struct stream *ls;
char *holdp;
+ if (!g_clip_up)
+ {
+ LOG(10, ("aborting clipboard_data_in - clipboard has not "
+ "been initialized"));
+ /* we return 0 here to indicate no protocol problem occured */
+ return 0;
+ }
+
LLOGLN(10, ("clipboard_data_in: chan_id %d "
"chan_flags 0x%x length %d total_length %d "
"in_request %d g_ins->size %d",
diff --git a/sesman/chansrv/sound.c b/sesman/chansrv/sound.c
index 55f6f88d..c4ca8261 100644
--- a/sesman/chansrv/sound.c
+++ b/sesman/chansrv/sound.c
@@ -302,6 +302,7 @@ sound_send_wave_data_chunk(char *data, int data_bytes)
if ((data_bytes < 4) || (data_bytes > 128 * 1024))
{
LOG(0, ("sound_send_wave_data_chunk: bad data_bytes %d", data_bytes));
+ return 0;
}
/* part one of 2 PDU wave info */
diff --git a/sesman/sesman.c b/sesman/sesman.c
index 4a294a5e..83db5961 100644
--- a/sesman/sesman.c
+++ b/sesman/sesman.c
@@ -143,7 +143,7 @@ main(int argc, char **argv)
enum logReturns error;
int daemon = 1;
int pid;
- char pid_s[8];
+ char pid_s[32];
char text[256];
char pid_file[256];
char cfg_file[256];
@@ -202,7 +202,8 @@ main(int argc, char **argv)
return 1;
}
- error = g_file_read(fd, pid_s, 7);
+ g_memset(pid_s, 0, sizeof(pid_s));
+ error = g_file_read(fd, pid_s, 31);
if (-1 == error)
{