Fix uc_set_tcp_keepalive_cfg, it really wasnt working :-(
This commit is contained in:
+3
-3
@@ -41,7 +41,7 @@ int uc_set_tcp_keepalive(int sockfd)
|
|||||||
return setsockopt(sockfd, SOL_SOCKET, SO_KEEPALIVE, &optval, sizeof(optval));
|
return setsockopt(sockfd, SOL_SOCKET, SO_KEEPALIVE, &optval, sizeof(optval));
|
||||||
}
|
}
|
||||||
|
|
||||||
int uc_set_tcp_keepalive_cfg(int sockfd, const struct UCKeepConfig *cfg)
|
int uc_set_tcp_keepalive_cfg(int sockfd, const struct uCKeepConfig *cfg)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
@@ -57,12 +57,12 @@ int uc_set_tcp_keepalive_cfg(int sockfd, const struct UCKeepConfig *cfg)
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPCNT, &cfg->keepidle, sizeof cfg->keepintvl);
|
rc = setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPIDLE, &cfg->keepidle, sizeof cfg->keepidle);
|
||||||
if (rc != 0) {
|
if (rc != 0) {
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPCNT, &cfg->keepintvl, sizeof cfg->keepintvl);
|
rc = setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPINTVL, &cfg->keepintvl, sizeof cfg->keepintvl);
|
||||||
if (rc != 0) {
|
if (rc != 0) {
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user