summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Talbert <swt@techie.net>2022-11-30 20:32:36 -0500
committerScott Talbert <swt@techie.net>2022-11-30 20:32:36 -0500
commit19d037ea18f47c389907f87b300c8c9de14d285b (patch)
tree7ea8bb4050de64b8025c486b497e57eeba8f39c6
parentef76f5b8780b3684cd91869358f3a647a7b92c33 (diff)
downloadpycurl-19d037ea18f47c389907f87b300c8c9de14d285b.tar.gz
Add support for CURL_HTTP_VERSION_3
-rw-r--r--src/module.c3
-rw-r--r--tests/option_constants_test.py4
2 files changed, 7 insertions, 0 deletions
diff --git a/src/module.c b/src/module.c
index 8efeab3..d55d3eb 100644
--- a/src/module.c
+++ b/src/module.c
@@ -1136,6 +1136,9 @@ initpycurl(void)
insint_c(d, "CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE", CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE);
insint_c(d, "TCP_FASTOPEN", CURLOPT_TCP_FASTOPEN);
#endif
+#if LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 66, 0)
+ insint_c(d, "CURL_HTTP_VERSION_3", CURL_HTTP_VERSION_3);
+#endif
insint_c(d, "CURL_HTTP_VERSION_LAST", CURL_HTTP_VERSION_LAST);
/* CURL_NETRC_OPTION: constants for setopt(NETRC, x) */
diff --git a/tests/option_constants_test.py b/tests/option_constants_test.py
index abba20e..479c4e7 100644
--- a/tests/option_constants_test.py
+++ b/tests/option_constants_test.py
@@ -496,6 +496,10 @@ class OptionConstantsSettingTest(unittest.TestCase):
def test_http_version_2prior_knowledge(self):
self.curl.setopt(self.curl.HTTP_VERSION, self.curl.CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE)
+ @util.min_libcurl(7, 66, 0)
+ def test_http_version_3(self):
+ self.curl.setopt(self.curl.HTTP_VERSION, self.curl.CURL_HTTP_VERSION_3)
+
@util.min_libcurl(7, 21, 5)
def test_sockopt_constants(self):
assert self.curl.SOCKOPT_OK is not None