From 19d037ea18f47c389907f87b300c8c9de14d285b Mon Sep 17 00:00:00 2001 From: Scott Talbert Date: Wed, 30 Nov 2022 20:32:36 -0500 Subject: Add support for CURL_HTTP_VERSION_3 --- src/module.c | 3 +++ tests/option_constants_test.py | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/src/module.c b/src/module.c index 8efeab3..d55d3eb 100644 --- a/src/module.c +++ b/src/module.c @@ -1135,6 +1135,9 @@ initpycurl(void) #if LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 49, 0) 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); 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 -- cgit v1.2.1