[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 04/05: Fixed tests compatibility with old libcurl
From: |
gnunet |
Subject: |
[libmicrohttpd] 04/05: Fixed tests compatibility with old libcurl |
Date: |
Sun, 12 Dec 2021 14:13:09 +0100 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit a08cfbe742ad15174a7b0d6cf12f53e9a686f99b
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Sun Dec 12 15:01:17 2021 +0300
Fixed tests compatibility with old libcurl
---
src/testcurl/test_get_close_keep_alive.c | 8 ++++++++
src/testcurl/test_tricky.c | 10 ++++++++++
2 files changed, 18 insertions(+)
diff --git a/src/testcurl/test_get_close_keep_alive.c
b/src/testcurl/test_get_close_keep_alive.c
index cb647f67..ea74ab24 100644
--- a/src/testcurl/test_get_close_keep_alive.c
+++ b/src/testcurl/test_get_close_keep_alive.c
@@ -57,6 +57,14 @@
#include <limits.h>
#endif /* HAVE_LIMITS_H */
+#ifndef CURL_VERSION_BITS
+#define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|(z))
+#endif /* ! CURL_VERSION_BITS */
+#ifndef CURL_AT_LEAST_VERSION
+#define CURL_AT_LEAST_VERSION(x,y,z) \
+ (LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z))
+#endif /* ! CURL_AT_LEAST_VERSION */
+
#if defined(MHD_CPU_COUNT) && (MHD_CPU_COUNT + 0) < 2
#undef MHD_CPU_COUNT
#endif
diff --git a/src/testcurl/test_tricky.c b/src/testcurl/test_tricky.c
index 8538fb28..51f87598 100644
--- a/src/testcurl/test_tricky.c
+++ b/src/testcurl/test_tricky.c
@@ -54,6 +54,14 @@
#include <limits.h>
#endif /* HAVE_LIMITS_H */
+#ifndef CURL_VERSION_BITS
+#define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|(z))
+#endif /* ! CURL_VERSION_BITS */
+#ifndef CURL_AT_LEAST_VERSION
+#define CURL_AT_LEAST_VERSION(x,y,z) \
+ (LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z))
+#endif /* ! CURL_AT_LEAST_VERSION */
+
#if defined(MHD_CPU_COUNT) && (MHD_CPU_COUNT + 0) < 2
#undef MHD_CPU_COUNT
#endif
@@ -486,8 +494,10 @@ curlEasyInitForTest (struct curlQueryParams *p,
lcurl_hdr_callback)) ||
(CURLE_OK != curl_easy_setopt (c, CURLOPT_HEADERDATA,
hdr_chk_result)) ||
+#if CURL_AT_LEAST_VERSION (7, 42, 0)
(CURLE_OK != curl_easy_setopt (c, CURLOPT_PATH_AS_IS,
(long) 1)) ||
+#endif /* CURL_AT_LEAST_VERSION(7, 42, 0) */
(CURLE_OK != curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L)) ||
(oneone) ?
(CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION,
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.