* introduced, oldest first, in the official version of cURL library.
*/
-/**
- * CURLOPT_TCP_KEEPALIVE was added in 7.25.0, released in March 2012.
- */
-#if LIBCURL_VERSION_NUM >= 0x071900
-#define GITCURL_HAVE_CURLOPT_TCP_KEEPALIVE 1
-#endif
-
-
/**
* CURLOPT_LOGIN_OPTIONS was added in 7.34.0, released in December
* 2013.
}
#endif
-#ifdef GITCURL_HAVE_CURLOPT_TCP_KEEPALIVE
static void set_curl_keepalive(CURL *c)
{
curl_easy_setopt(c, CURLOPT_TCP_KEEPALIVE, 1);
}
-#else
-static int sockopt_callback(void *client, curl_socket_t fd, curlsocktype type)
-{
- int ka = 1;
- int rc;
- socklen_t len = (socklen_t)sizeof(ka);
-
- if (type != CURLSOCKTYPE_IPCXN)
- return 0;
-
- rc = setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, (void *)&ka, len);
- if (rc < 0)
- warning_errno("unable to set SO_KEEPALIVE on socket");
-
- return CURL_SOCKOPT_OK;
-}
-
-static void set_curl_keepalive(CURL *c)
-{
- curl_easy_setopt(c, CURLOPT_SOCKOPTFUNCTION, sockopt_callback);
-}
-#endif
-
/* Return 1 if redactions have been made, 0 otherwise. */
static int redact_sensitive_header(struct strbuf *header, size_t offset)
{