[gnome-remote-desktop] session-rdp: Handle queued bandwidth measure stop operations
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-remote-desktop] session-rdp: Handle queued bandwidth measure stop operations
- Date: Thu, 19 May 2022 16:25:44 +0000 (UTC)
commit 2bb9e506a99b728f32030f7132b637cba3e46ad1
Author: Pascal Nowack <Pascal Nowack gmx de>
Date: Tue May 17 12:24:58 2022 +0200
session-rdp: Handle queued bandwidth measure stop operations
The socket thread, where channel messages, including graphics updates
via the graphics pipeline, are sent to the client, needs to take care
of sending queued Bandwidth Measure Stop PDUs.
To do this, use the previously implemented APIs to retrieve the event
handle for queued updated and the API to actually send the Bandwidth
Measure Stop PDU.
src/grd-session-rdp.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
---
diff --git a/src/grd-session-rdp.c b/src/grd-session-rdp.c
index 1260216d..e9b5fe9f 100644
--- a/src/grd-session-rdp.c
+++ b/src/grd-session-rdp.c
@@ -2011,9 +2011,20 @@ socket_thread_func (gpointer data)
while (TRUE)
{
+ GrdRdpNetworkAutodetection *network_autodetection =
+ rdp_peer_context->network_autodetection;
+ gboolean pending_bw_measure_stop = FALSE;
+ HANDLE bw_measure_stop_event = NULL;
+
n_events = 0;
events[n_events++] = session_rdp->stop_event;
+ if (network_autodetection)
+ {
+ bw_measure_stop_event =
+ grd_rdp_network_autodetection_get_bw_measure_stop_event_handle (network_autodetection);
+ events[n_events++] = bw_measure_stop_event;
+ }
n_freerdp_handles = peer->GetEventHandles (peer, &events[n_events],
32 - n_events);
@@ -2068,6 +2079,12 @@ socket_thread_func (gpointer data)
break;
}
+ if (bw_measure_stop_event)
+ {
+ pending_bw_measure_stop = WaitForSingleObject (bw_measure_stop_event,
+ 0) == WAIT_OBJECT_0;
+ }
+
if (WaitForSingleObject (channel_event, 0) == WAIT_OBJECT_0 &&
!WTSVirtualChannelManagerCheckFileDescriptor (vcm))
{
@@ -2075,6 +2092,9 @@ socket_thread_func (gpointer data)
handle_client_gone (session_rdp);
break;
}
+
+ if (pending_bw_measure_stop)
+ grd_rdp_network_autodetection_bw_measure_stop (network_autodetection);
}
if (session_rdp->hwaccel_nvidia)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]