Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--git-curl-compat.h11
-rw-r--r--http.c2
2 files changed, 12 insertions, 1 deletions
diff --git a/git-curl-compat.h b/git-curl-compat.h
index 7ad87e89ed..a308bdb3b9 100644
--- a/git-curl-compat.h
+++ b/git-curl-compat.h
@@ -20,11 +20,22 @@
* GIT_CURL_HAVE_X. If multiple similar symbols with the same prefix
* were defined in the same version we pick one and check for that name.
*
+ * We may also define a missing CURL_* symbol to its known value, if
+ * doing so is sufficient to add support for it to older versions that
+ * don't have it.
+ *
* Keep any symbols in date order of when their support was
* introduced, oldest first, in the official version of cURL library.
*/
/**
+ * CURL_SOCKOPT_OK was added in 7.21.5, released in April 2011.
+ */
+#if LIBCURL_VERSION_NUM < 0x071505
+#define CURL_SOCKOPT_OK 0
+#endif
+
+/**
* CURLOPT_TCP_KEEPALIVE was added in 7.25.0, released in March 2012.
*/
#if LIBCURL_VERSION_NUM >= 0x071900
diff --git a/http.c b/http.c
index 94eefe9708..d7c20493d7 100644
--- a/http.c
+++ b/http.c
@@ -537,7 +537,7 @@ static int sockopt_callback(void *client, curl_socket_t fd, curlsocktype type)
if (rc < 0)
warning_errno("unable to set SO_KEEPALIVE on socket");
- return 0; /* CURL_SOCKOPT_OK only exists since curl 7.21.5 */
+ return CURL_SOCKOPT_OK;
}
static void set_curl_keepalive(CURL *c)