mirror of
https://github.com/GOSTSec/sgminer
synced 2025-08-26 13:52:02 +00:00
Return value of keep_sockalive is no longer used.
This commit is contained in:
parent
8fcc67f308
commit
15e5e36bcd
26
util.c
26
util.c
@ -212,36 +212,22 @@ static void keep_alive(CURL *curl, __maybe_unused SOCKETTYPE fd)
|
|||||||
keep_curlalive(curl);
|
keep_curlalive(curl);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
static int keep_sockalive(SOCKETTYPE fd)
|
static void keep_sockalive(SOCKETTYPE fd)
|
||||||
{
|
{
|
||||||
const int tcp_keepidle = 60;
|
const int tcp_keepidle = 60;
|
||||||
const int tcp_keepintvl = 60;
|
const int tcp_keepintvl = 60;
|
||||||
const int keepalive = 1;
|
const int keepalive = 1;
|
||||||
const int tcp_keepcnt = 5;
|
const int tcp_keepcnt = 5;
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
if (unlikely(setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &keepalive, sizeof(keepalive))))
|
|
||||||
ret = 1;
|
|
||||||
|
|
||||||
|
setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &keepalive, sizeof(keepalive));
|
||||||
# ifdef __linux
|
# ifdef __linux
|
||||||
|
setsockopt(fd, SOL_TCP, TCP_KEEPCNT, &tcp_keepcnt, sizeof(tcp_keepcnt));
|
||||||
if (unlikely(setsockopt(fd, SOL_TCP, TCP_KEEPCNT, &tcp_keepcnt, sizeof(tcp_keepcnt))))
|
setsockopt(fd, SOL_TCP, TCP_KEEPIDLE, &tcp_keepidle, sizeof(tcp_keepidle));
|
||||||
ret = 1;
|
setsockopt(fd, SOL_TCP, TCP_KEEPINTVL, &tcp_keepintvl, sizeof(tcp_keepintvl));
|
||||||
|
|
||||||
if (unlikely(setsockopt(fd, SOL_TCP, TCP_KEEPIDLE, &tcp_keepidle, sizeof(tcp_keepidle))))
|
|
||||||
ret = 1;
|
|
||||||
|
|
||||||
if (unlikely(setsockopt(fd, SOL_TCP, TCP_KEEPINTVL, &tcp_keepintvl, sizeof(tcp_keepintvl))))
|
|
||||||
ret = 1;
|
|
||||||
# endif /* __linux */
|
# endif /* __linux */
|
||||||
# ifdef __APPLE_CC__
|
# ifdef __APPLE_CC__
|
||||||
|
setsockopt(fd, IPPROTO_TCP, TCP_KEEPALIVE, &tcp_keepintvl, sizeof(tcp_keepintvl));
|
||||||
if (unlikely(setsockopt(fd, IPPROTO_TCP, TCP_KEEPALIVE, &tcp_keepintvl, sizeof(tcp_keepintvl))))
|
|
||||||
ret = 1;
|
|
||||||
|
|
||||||
# endif /* __APPLE_CC__ */
|
# endif /* __APPLE_CC__ */
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void keep_curlalive(CURL *curl)
|
static void keep_curlalive(CURL *curl)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user