Fix uc_set_tcp_keepalive_cfg, it really wasnt working :-(

This commit is contained in:
Nils O. Selåsdal
2013-11-21 21:31:33 +01:00
parent 37ebc2a75b
commit 02c555bd6c
+3 -3
View File
@@ -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;
} }