diff --git a/include/freerdp/settings.h b/include/freerdp/settings.h index ba3eb33e4..3cad588a4 100644 --- a/include/freerdp/settings.h +++ b/include/freerdp/settings.h @@ -882,8 +882,9 @@ typedef struct _RDPDR_PARALLEL RDPDR_PARALLEL; #define FreeRDP_RDP2TCPArgs (5189) #define FreeRDP_TcpKeepAlive (5190) #define FreeRDP_TcpKeepAliveRetries (5191) -#define FreeRDP_TcpKeepAliveInterval (5192) -#define FreeRDP_TcpAckTimeout (5193) +#define FreeRDP_TcpKeepAliveDelay (5192) +#define FreeRDP_TcpKeepAliveInterval (5193) +#define FreeRDP_TcpAckTimeout (5194) /** * FreeRDP Settings Data Structure @@ -1526,9 +1527,10 @@ struct rdp_settings ALIGN64 char* RDP2TCPArgs; /* 5189 */ ALIGN64 BOOL TcpKeepAlive; /* 5190 */ ALIGN64 UINT32 TcpKeepAliveRetries; /* 5191 */ - ALIGN64 UINT32 TcpKeepAliveInterval; /* 5192 */ - ALIGN64 UINT32 TcpAckTimeout; /* 5193 */ - UINT64 padding5312[5312 - 5193]; /* 5193 */ + ALIGN64 UINT32 TcpKeepAliveDelay; /* 5192 */ + ALIGN64 UINT32 TcpKeepAliveInterval; /* 5193 */ + ALIGN64 UINT32 TcpAckTimeout; /* 5194 */ + UINT64 padding5312[5312 - 5195]; /* 5195 */ /** * WARNING: End of ABI stable zone! diff --git a/libfreerdp/common/settings_getters.c b/libfreerdp/common/settings_getters.c index 0e85086b8..86bacd00b 100644 --- a/libfreerdp/common/settings_getters.c +++ b/libfreerdp/common/settings_getters.c @@ -1562,6 +1562,9 @@ UINT32 freerdp_settings_get_uint32(const rdpSettings* settings, size_t id) case FreeRDP_TcpKeepAliveRetries: return settings->TcpKeepAliveRetries; + case FreeRDP_TcpKeepAliveDelay: + return settings->TcpKeepAliveDelay; + case FreeRDP_TcpKeepAliveInterval: return settings->TcpKeepAliveInterval; @@ -2009,6 +2012,10 @@ BOOL freerdp_settings_set_uint32(rdpSettings* settings, size_t id, UINT32 val) settings->TcpKeepAliveRetries = val; break; + case FreeRDP_TcpKeepAliveDelay: + settings->TcpKeepAliveDelay = val; + break; + case FreeRDP_TcpKeepAliveInterval: settings->TcpKeepAliveInterval = val; break; diff --git a/libfreerdp/core/settings.c b/libfreerdp/core/settings.c index 0ea9d23ea..11c3feb2e 100644 --- a/libfreerdp/core/settings.c +++ b/libfreerdp/core/settings.c @@ -561,7 +561,8 @@ rdpSettings* freerdp_settings_new(DWORD flags) settings->TcpKeepAlive = TRUE; settings->TcpKeepAliveRetries = 3; - settings->TcpKeepAliveInterval = 5; + settings->TcpKeepAliveDelay = 5; + settings->TcpKeepAliveInterval = 2; settings->TcpAckTimeout = 9000; if (!settings->ServerMode) diff --git a/libfreerdp/core/tcp.c b/libfreerdp/core/tcp.c index 52693ba68..f1ecc6bc3 100644 --- a/libfreerdp/core/tcp.c +++ b/libfreerdp/core/tcp.c @@ -1006,7 +1006,7 @@ static BOOL freerdp_tcp_set_keep_alive_mode(const rdpSettings* settings, int soc #ifndef _WIN32 #ifdef TCP_KEEPIDLE - optval = keepalive ? freerdp_settings_get_uint32(settings, FreeRDP_TcpKeepAliveInterval) : 0; + optval = keepalive ? freerdp_settings_get_uint32(settings, FreeRDP_TcpKeepAliveDelay) : 0; optlen = sizeof(optval); if (setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPIDLE, (void*)&optval, optlen) < 0) diff --git a/libfreerdp/core/test/settings_property_lists.h b/libfreerdp/core/test/settings_property_lists.h index 4610a78e8..8e608c970 100644 --- a/libfreerdp/core/test/settings_property_lists.h +++ b/libfreerdp/core/test/settings_property_lists.h @@ -282,6 +282,7 @@ static const size_t uint32_list_indices[] = { FreeRDP_DynamicChannelCount, FreeRDP_DynamicChannelArraySize, FreeRDP_TcpKeepAliveRetries, + FreeRDP_TcpKeepAliveDelay, FreeRDP_TcpKeepAliveInterval, FreeRDP_TcpAckTimeout, };