Skip to content

Commit

Permalink
Revert "guacamole: only flash frame after render"
Browse files Browse the repository at this point in the history
This reverts commit 7cca58e.
  • Loading branch information
changkun committed Nov 8, 2019
1 parent daa6393 commit ad688ff
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
11 changes: 7 additions & 4 deletions guacamole/src/protocols/rdp/rdp.c
Expand Up @@ -819,10 +819,6 @@ static int guac_rdp_handle_connection(guac_client* client) {
* excluded from the required wait period of the next frame). */
last_frame_end = frame_start;

/* Flush frame */
guac_common_display_flush(rdp_client->display);
guac_client_end_frame(client);
guac_socket_flush(client->socket);
}

/* Test whether the RDP server is closing the connection */
Expand All @@ -839,6 +835,13 @@ static int guac_rdp_handle_connection(guac_client* client) {
guac_client_abort(client, GUAC_PROTOCOL_STATUS_UPSTREAM_UNAVAILABLE,
"Connection closed.");

/* Flush frame only if successful */
else {
guac_common_display_flush(rdp_client->display);
guac_client_end_frame(client);
guac_socket_flush(client->socket);
}

}

/* Clean up print job, if active */
Expand Down
12 changes: 7 additions & 5 deletions guacamole/src/protocols/ssh/terminal.c
Expand Up @@ -246,8 +246,13 @@ void* guac_terminal_thread(void* data) {
while (client->state == GUAC_CLIENT_RUNNING) {

/* Stop rendering if an error occurs */
if (guac_terminal_render_frame(terminal, client))
if (guac_terminal_render_frame(terminal))
break;

/* Signal end of frame */
guac_client_end_frame(client);
guac_socket_flush(client->socket);

}

/* The client has stopped or an error has occurred */
Expand Down Expand Up @@ -769,7 +774,7 @@ static int guac_terminal_wait(guac_terminal* terminal, int msec_timeout) {

}

int guac_terminal_render_frame(guac_terminal* terminal, guac_client* client) {
int guac_terminal_render_frame(guac_terminal* terminal) {

int wait_result;

Expand Down Expand Up @@ -800,9 +805,6 @@ int guac_terminal_render_frame(guac_terminal* terminal, guac_client* client) {
guac_terminal_flush(terminal);
guac_terminal_unlock(terminal);

/* Signal end of frame */
guac_client_end_frame(client);
guac_socket_flush(client->socket);
}

return 0;
Expand Down
2 changes: 1 addition & 1 deletion guacamole/src/protocols/ssh/terminal.h
Expand Up @@ -512,7 +512,7 @@ void guac_terminal_free(guac_terminal* term);
* Renders a single frame of terminal data. If data is not yet available,
* this function will block until data is written.
*/
int guac_terminal_render_frame(guac_terminal* terminal, guac_client* client);
int guac_terminal_render_frame(guac_terminal* terminal);

/**
* Reads from this terminal's STDIN. Input comes from key and mouse events
Expand Down
9 changes: 5 additions & 4 deletions guacamole/src/protocols/vnc/vnc.c
Expand Up @@ -282,16 +282,17 @@ void* guac_vnc_client_thread(void* data) {
* excluded from the required wait period of the next frame). */
last_frame_end = frame_start;

/* Flush frame */
guac_common_surface_flush(vnc_client->display->default_surface);
guac_client_end_frame(client);
guac_socket_flush(client->socket);
}

/* If an error occurs, log it and fail */
if (wait_result < 0)
guac_client_abort(client, GUAC_PROTOCOL_STATUS_UPSTREAM_ERROR, "Connection closed.");

/* Flush frame */
guac_common_surface_flush(vnc_client->display->default_surface);
guac_client_end_frame(client);
guac_socket_flush(client->socket);

}

/* Kill client and finish connection */
Expand Down

0 comments on commit ad688ff

Please sign in to comment.