GUACAMOLE-1140: Merge correction to pipe SVC race condition.

This commit is contained in:
Mike Jumper 2024-01-09 00:49:19 -08:00 committed by GitHub
commit f5bab5541d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 8 deletions

View File

@ -48,16 +48,18 @@ void guac_rdp_pipe_svc_send_pipes(
guac_rdp_client* rdp_client = (guac_rdp_client*) client->data;
guac_common_list_lock(rdp_client->available_svc);
if (rdp_client->available_svc != NULL) {
guac_common_list_lock(rdp_client->available_svc);
/* Send pipe for each allocated SVC's output stream */
guac_common_list_element* current = rdp_client->available_svc->head;
while (current != NULL) {
guac_rdp_pipe_svc_send_pipe(socket, (guac_rdp_pipe_svc*) current->data);
current = current->next;
/* Send pipe for each allocated SVC's output stream */
guac_common_list_element* current = rdp_client->available_svc->head;
while (current != NULL) {
guac_rdp_pipe_svc_send_pipe(socket, (guac_rdp_pipe_svc*) current->data);
current = current->next;
}
guac_common_list_unlock(rdp_client->available_svc);
}
guac_common_list_unlock(rdp_client->available_svc);
}
void guac_rdp_pipe_svc_add(guac_client* client, guac_rdp_pipe_svc* pipe_svc) {

View File

@ -117,6 +117,8 @@ static int guac_rdp_join_pending_handler(guac_client* client) {
guac_rdp_client* rdp_client = (guac_rdp_client*) client->data;
guac_socket* broadcast_socket = client->pending_socket;
pthread_rwlock_rdlock(&(rdp_client->lock));
/* Synchronize any audio stream for each pending user */
if (rdp_client->audio)
guac_client_foreach_pending_user(
@ -131,6 +133,8 @@ static int guac_rdp_join_pending_handler(guac_client* client) {
guac_socket_flush(broadcast_socket);
}
pthread_rwlock_unlock(&(rdp_client->lock));
return 0;
}