mirror of
https://github.com/curl/curl.git
synced 2026-05-19 07:36:22 +03:00
cf-socket: prevent KEEPALIVE_FACTOR being set to 1000 for Windows
Fixes #14368 Reported-by: feelingseas on github Closes #14606
This commit is contained in:
parent
26e9d3a896
commit
d8cefac245
1 changed files with 8 additions and 2 deletions
|
|
@ -146,7 +146,13 @@ static void nosigpipe(struct Curl_easy *data,
|
|||
#define nosigpipe(x,y) Curl_nop_stmt
|
||||
#endif
|
||||
|
||||
#if defined(USE_WINSOCK) || \
|
||||
#if defined(USE_WINSOCK) && \
|
||||
defined(TCP_KEEPIDLE) && defined(TCP_KEEPINTVL) && defined(TCP_KEEPCNT)
|
||||
/* Win 10, v 1709 (10.0.16299) and later can use SetSockOpt TCP_KEEP____
|
||||
* so should use seconds */
|
||||
#define CURL_WINSOCK_KEEP_SSO
|
||||
#define KEEPALIVE_FACTOR(x)
|
||||
#elif defined(USE_WINSOCK) || \
|
||||
(defined(__sun) && !defined(TCP_KEEPIDLE)) || \
|
||||
(defined(__DragonFly__) && __DragonFly_version < 500702) || \
|
||||
(defined(_WIN32) && !defined(TCP_KEEPIDLE))
|
||||
|
|
@ -183,7 +189,7 @@ tcpkeepalive(struct Curl_easy *data,
|
|||
else {
|
||||
#if defined(SIO_KEEPALIVE_VALS) /* Windows */
|
||||
/* Windows 10, version 1709 (10.0.16299) and later versions */
|
||||
#if defined(TCP_KEEPIDLE) && defined(TCP_KEEPINTVL) && defined(TCP_KEEPCNT)
|
||||
#if defined(CURL_WINSOCK_KEEP_SSO)
|
||||
optval = curlx_sltosi(data->set.tcp_keepidle);
|
||||
KEEPALIVE_FACTOR(optval);
|
||||
if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPIDLE,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue