From fdeb3934e09bdfd92c567a41847b64a9149a899a Mon Sep 17 00:00:00 2001 From: Koichiro Iwao Date: Wed, 21 Aug 2024 22:08:50 +0900 Subject: [PATCH 1/2] Constify a raw 40ms timer --- module/rdpClientCon.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/module/rdpClientCon.c b/module/rdpClientCon.c index 8b3ac2f..b537ac0 100644 --- a/module/rdpClientCon.c +++ b/module/rdpClientCon.c @@ -61,6 +61,10 @@ Client connection to xrdp #define USE_MAX_OS_BYTES 1 #define MAX_OS_BYTES (16 * 1024 * 1024) +#define MIN_MS_BETWEEN_FRAMES 40 +#define MIN_MS_TO_WAIT_FOR_MORE_UPDATES 4 +#define UPDATE_RETRY_TIMEOUT 200 // After this number of retries, give up and perform the capture anyway. This prevents an infinite loop. + /* 0 GXclear, 0 1 GXnor, DPon @@ -2539,7 +2543,7 @@ rdpClientConScheduleDeferredUpdate(rdpPtr dev) { dev->sendUpdateScheduled = TRUE; dev->sendUpdateTimer = - TimerSet(dev->sendUpdateTimer, 0, 40, + TimerSet(dev->sendUpdateTimer, 0, MIN_MS_BETWEEN_FRAMES, rdpClientConDeferredUpdateCallback, dev); } } @@ -2981,9 +2985,6 @@ rdpDeferredUpdateCallback(OsTimerPtr timer, CARD32 now, pointer arg) /******************************************************************************/ -#define MIN_MS_BETWEEN_FRAMES 40 -#define MIN_MS_TO_WAIT_FOR_MORE_UPDATES 4 -#define UPDATE_RETRY_TIMEOUT 200 // After this number of retries, give up and perform the capture anyway. This prevents an infinite loop. static void rdpScheduleDeferredUpdate(rdpClientCon *clientCon) { From 41007d2ef0df993205ec5248eb49e014c1ae9f86 Mon Sep 17 00:00:00 2001 From: Koichiro Iwao Date: Wed, 28 Aug 2024 14:33:52 +0900 Subject: [PATCH 2/2] Remove unused UPDATE_RETRY_TIMEOUT --- module/rdpClientCon.c | 1 - 1 file changed, 1 deletion(-) diff --git a/module/rdpClientCon.c b/module/rdpClientCon.c index b537ac0..72556ca 100644 --- a/module/rdpClientCon.c +++ b/module/rdpClientCon.c @@ -63,7 +63,6 @@ Client connection to xrdp #define MIN_MS_BETWEEN_FRAMES 40 #define MIN_MS_TO_WAIT_FOR_MORE_UPDATES 4 -#define UPDATE_RETRY_TIMEOUT 200 // After this number of retries, give up and perform the capture anyway. This prevents an infinite loop. /* 0 GXclear, 0