summaryrefslogtreecommitdiffstats
path: root/xrdp
diff options
context:
space:
mode:
authorJay Sorg <jay.sorg@gmail.com>2017-03-01 21:30:54 -0800
committerjsorg71 <jay.sorg@gmail.com>2017-03-06 22:44:26 -0800
commit3b056ec052d8b151e11617f3bba07eb7e0d116ef (patch)
tree21de9c50dba53093bea14e46caf00f681823cfcf /xrdp
parent30a7a947b1825c0527ca8ed14b686c5165e4c817 (diff)
downloadxrdp-proprietary-3b056ec052d8b151e11617f3bba07eb7e0d116ef.tar.gz
xrdp-proprietary-3b056ec052d8b151e11617f3bba07eb7e0d116ef.zip
frame ack fix change, cleanup
Diffstat (limited to 'xrdp')
-rw-r--r--xrdp/xrdp_encoder.c3
-rw-r--r--xrdp/xrdp_encoder.h1
-rw-r--r--xrdp/xrdp_mm.c8
3 files changed, 8 insertions, 4 deletions
diff --git a/xrdp/xrdp_encoder.c b/xrdp/xrdp_encoder.c
index e6ae185c..46bfeccf 100644
--- a/xrdp/xrdp_encoder.c
+++ b/xrdp/xrdp_encoder.c
@@ -136,6 +136,9 @@ xrdp_encoder_create(struct xrdp_mm *mm)
g_snprintf(buf, 1024, "xrdp_%8.8x_encoder_term", pid);
self->xrdp_encoder_term = g_create_wait_obj(buf);
self->max_compressed_bytes = client_info->max_fastpath_frag_bytes & ~15;
+ self->frames_in_flight = client_info->max_unacknowledged_frame_count;
+ /* make sure frames_in_flight is at least 1 */
+ self->frames_in_flight = MAX(self->frames_in_flight, 1);
/* create thread to process messages */
tc_thread_create(proc_enc_msg, self);
diff --git a/xrdp/xrdp_encoder.h b/xrdp/xrdp_encoder.h
index 4c57471c..0cb21951 100644
--- a/xrdp/xrdp_encoder.h
+++ b/xrdp/xrdp_encoder.h
@@ -26,6 +26,7 @@ struct xrdp_encoder
int frame_id_client; /* last frame id received from client */
int frame_id_server; /* last frame id received from Xorg */
int frame_id_server_sent;
+ int frames_in_flight;
};
/* used when scheduling tasks in xrdp_encoder.c */
diff --git a/xrdp/xrdp_mm.c b/xrdp/xrdp_mm.c
index 7fcb0120..d56624ca 100644
--- a/xrdp/xrdp_mm.c
+++ b/xrdp/xrdp_mm.c
@@ -2274,6 +2274,7 @@ xrdp_mm_check_wait_objs(struct xrdp_mm *self)
if (enc_done->last)
{
LLOGLN(10, ("xrdp_mm_check_wait_objs: last set"));
+ self->encoder->frame_id_server = enc_done->enc->frame_id;
if (use_frame_acks == 0)
{
self->mod->mod_frame_ack(self->mod,
@@ -2282,7 +2283,7 @@ xrdp_mm_check_wait_objs(struct xrdp_mm *self)
}
else
{
- ex = self->wm->client_info->max_unacknowledged_frame_count;
+ ex = self->encoder->frames_in_flight;
if (self->encoder->frame_id_client + ex > self->encoder->frame_id_server)
{
if (self->encoder->frame_id_server > self->encoder->frame_id_server_sent)
@@ -2323,9 +2324,9 @@ xrdp_mm_frame_ack(struct xrdp_mm *self, int frame_id)
{
return 1;
}
- ex = self->wm->client_info->max_unacknowledged_frame_count;
+ ex = self->encoder->frames_in_flight;
/* make sure we won't have too many in-flight frames */
- if (self->encoder->frame_id_client + ex >= self->encoder->frame_id_server)
+ if (self->encoder->frame_id_client + ex > self->encoder->frame_id_server)
{
if (self->encoder->frame_id_server > self->encoder->frame_id_server_sent)
{
@@ -2597,7 +2598,6 @@ server_paint_rects(struct xrdp_mod* mod, int num_drects, short *drects,
enc_data->height = height;
enc_data->flags = flags;
enc_data->frame_id = frame_id;
- mm->encoder->frame_id_server = frame_id;
if (width == 0 || height == 0)
{
LLOGLN(10, ("server_paint_rects: error"));