GUACAMOLE-172: Exclude server-side rendering time from next frame's required wait (if render times are consistent, then including that time will result in duplicate waiting: once within the render loop, and again when actually flushing the display).
Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/commit/f641d91b Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/tree/f641d91b Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/diff/f641d91b Branch: refs/heads/master Commit: f641d91b552fdf27ac7de7e253912c7b31d7c0dd Parents: 9e6e4e5 Author: Michael Jumper <[email protected]> Authored: Fri Oct 7 14:02:17 2016 -0700 Committer: Michael Jumper <[email protected]> Committed: Tue Jan 24 00:18:04 2017 -0800 ---------------------------------------------------------------------- src/protocols/rdp/rdp.c | 10 +++++++--- src/protocols/vnc/vnc.c | 9 ++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/f641d91b/src/protocols/rdp/rdp.c ---------------------------------------------------------------------- diff --git a/src/protocols/rdp/rdp.c b/src/protocols/rdp/rdp.c index e759888..cf55c75 100644 --- a/src/protocols/rdp/rdp.c +++ b/src/protocols/rdp/rdp.c @@ -839,14 +839,18 @@ static int guac_rdp_handle_connection(guac_client* client) { guac_client_abort(client, GUAC_PROTOCOL_STATUS_UPSTREAM_ERROR, "Connection closed."); + /* Record end of frame, excluding server-side rendering time (we assume + * server-side rendering time will be consistent between any two + * subsequent frames, and that this time should thus be excluded from + * the required wait period of the next frame). */ + last_frame_end = guac_timestamp_current(); + + /* Flush frame */ /* End of frame */ guac_common_display_flush(rdp_client->display); guac_client_end_frame(client); guac_socket_flush(client->socket); - /* Record end of frame */ - last_frame_end = guac_timestamp_current(); - } pthread_mutex_lock(&(rdp_client->rdp_lock)); http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/f641d91b/src/protocols/vnc/vnc.c ---------------------------------------------------------------------- diff --git a/src/protocols/vnc/vnc.c b/src/protocols/vnc/vnc.c index f9ab687..4f1e8da 100644 --- a/src/protocols/vnc/vnc.c +++ b/src/protocols/vnc/vnc.c @@ -408,14 +408,17 @@ void* guac_vnc_client_thread(void* data) { if (wait_result < 0) guac_client_abort(client, GUAC_PROTOCOL_STATUS_UPSTREAM_ERROR, "Connection closed."); + /* Record end of frame, excluding server-side rendering time (we assume + * server-side rendering time will be consistent between any two + * subsequent frames, and that this time should thus be excluded from + * the required wait period of the next frame). */ + last_frame_end = guac_timestamp_current(); + /* Flush frame */ guac_common_surface_flush(vnc_client->display->default_surface); guac_client_end_frame(client); guac_socket_flush(client->socket); - /* Record end of frame */ - last_frame_end = guac_timestamp_current(); - } /* Kill client and finish connection */
