From 01f7644e4c97aff8bfa3dda6ddf5da9a4330d923 Mon Sep 17 00:00:00 2001 From: Kobi Mizrachi Date: Tue, 7 Jul 2020 10:16:46 +0300 Subject: [PATCH] server: proxy: proxy rdp heartbeats (cherry picked from commit 659e4c772bbc7e3807dc94628934e8982f8efcf7) --- server/proxy/pf_client.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/server/proxy/pf_client.c b/server/proxy/pf_client.c index 0db33f8..4f6d00c 100644 --- a/server/proxy/pf_client.c +++ b/server/proxy/pf_client.c @@ -156,12 +156,6 @@ static BOOL pf_client_use_peer_load_balance_info(pClientContext* pc) return TRUE; } -/** - * Called before a connection is established. - * - * TODO: Take client to proxy settings and use channel whitelist to filter out - * unwanted channels. - */ static BOOL pf_client_pre_connect(freerdp* instance) { pClientContext* pc = (pClientContext*)instance->context; @@ -273,6 +267,13 @@ static BOOL pf_client_receive_channel_data_hook(freerdp* instance, UINT16 channe return client_receive_channel_data_original(instance, channelId, data, size, flags, totalSize); } +static BOOL pf_client_on_server_heartbeat(freerdp* instance, BYTE period, BYTE count1, BYTE count2) +{ + pClientContext* pc = (pClientContext*)instance->context; + pServerContext* ps = pc->pdata->ps; + return freerdp_heartbeat_send_heartbeat_pdu(ps->context.peer, period, count1, count2); +} + /** * Called after a RDP connection was successfully established. * Settings might have changed during negotiation of client / server feature @@ -348,6 +349,8 @@ static BOOL pf_client_post_connect(freerdp* instance) } } + instance->heartbeat->ServerHeartbeat = pf_client_on_server_heartbeat; + /* * after the connection fully established and settings were negotiated with target server, * send a reactivation sequence to the client with the negotiated settings. This way, -- 2.7.4