GUACAMOLE-1140: Merge correction to pipe SVC race condition.
This commit is contained in:
commit
f5bab5541d
@ -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) {
|
||||
|
||||
@ -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;
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user