summaryrefslogtreecommitdiff
path: root/git-curl-compat.h
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2021-09-13 14:51:29 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-09-13 17:39:04 (GMT)
commit32da6e6dafb1db563b6fa1ec80a21d58268e4ad1 (patch)
tree255f422f6bd3366b887941438e4e990d803960e4 /git-curl-compat.h
parente4ff3b67c2ad854113331029dea9843928a9c5ae (diff)
downloadgit-32da6e6dafb1db563b6fa1ec80a21d58268e4ad1.zip
git-32da6e6dafb1db563b6fa1ec80a21d58268e4ad1.tar.gz
git-32da6e6dafb1db563b6fa1ec80a21d58268e4ad1.tar.bz2
http: don't hardcode the value of CURL_SOCKOPT_OK
Use the new git-curl-compat.h header to define CURL_SOCKOPT_OK to its known value if we're on an older curl version that doesn't have it. It was hardcoded in http.c in a15d069a198 (http: enable keepalive on TCP sockets, 2013-10-12). Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-curl-compat.h')
-rw-r--r--git-curl-compat.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/git-curl-compat.h b/git-curl-compat.h
index 7ad87e8..a308bdb 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