diff options
-rw-r--r-- | lib/connect.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/connect.c b/lib/connect.c index e159a2b5c..6090abb36 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -148,6 +148,15 @@ tcpkeepalive(struct SessionHandle *data, infof(data, "Failed to set TCP_KEEPINTVL on fd %d\n", sockfd); } #endif +#ifdef TCP_KEEPALIVE + /* Mac OS X style */ + optval = curlx_sltosi(data->set.tcp_keepidle); + KEEPALIVE_FACTOR(optval); + if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPALIVE, + (void *)&optval, sizeof(optval)) < 0) { + infof(data, "Failed to set TCP_KEEPALIVE on fd %d\n", sockfd); + } +#endif #endif } } |