aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2021-12-12 15:01:17 +0300
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2021-12-12 16:10:28 +0300
commita08cfbe742ad15174a7b0d6cf12f53e9a686f99b (patch)
tree5610b1baacec021b1438dd48ca3b84e0c8fb9037
parent69854dc4359ae3ba16ddd65d51741bdf302d8cfb (diff)
downloadlibmicrohttpd-a08cfbe742ad15174a7b0d6cf12f53e9a686f99b.tar.gz
libmicrohttpd-a08cfbe742ad15174a7b0d6cf12f53e9a686f99b.zip
Fixed tests compatibility with old libcurl
-rw-r--r--src/testcurl/test_get_close_keep_alive.c8
-rw-r--r--src/testcurl/test_tricky.c10
2 files changed, 18 insertions, 0 deletions
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 @@
57#include <limits.h> 57#include <limits.h>
58#endif /* HAVE_LIMITS_H */ 58#endif /* HAVE_LIMITS_H */
59 59
60#ifndef CURL_VERSION_BITS
61#define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|(z))
62#endif /* ! CURL_VERSION_BITS */
63#ifndef CURL_AT_LEAST_VERSION
64#define CURL_AT_LEAST_VERSION(x,y,z) \
65 (LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z))
66#endif /* ! CURL_AT_LEAST_VERSION */
67
60#if defined(MHD_CPU_COUNT) && (MHD_CPU_COUNT + 0) < 2 68#if defined(MHD_CPU_COUNT) && (MHD_CPU_COUNT + 0) < 2
61#undef MHD_CPU_COUNT 69#undef MHD_CPU_COUNT
62#endif 70#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 @@
54#include <limits.h> 54#include <limits.h>
55#endif /* HAVE_LIMITS_H */ 55#endif /* HAVE_LIMITS_H */
56 56
57#ifndef CURL_VERSION_BITS
58#define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|(z))
59#endif /* ! CURL_VERSION_BITS */
60#ifndef CURL_AT_LEAST_VERSION
61#define CURL_AT_LEAST_VERSION(x,y,z) \
62 (LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z))
63#endif /* ! CURL_AT_LEAST_VERSION */
64
57#if defined(MHD_CPU_COUNT) && (MHD_CPU_COUNT + 0) < 2 65#if defined(MHD_CPU_COUNT) && (MHD_CPU_COUNT + 0) < 2
58#undef MHD_CPU_COUNT 66#undef MHD_CPU_COUNT
59#endif 67#endif
@@ -486,8 +494,10 @@ curlEasyInitForTest (struct curlQueryParams *p,
486 lcurl_hdr_callback)) || 494 lcurl_hdr_callback)) ||
487 (CURLE_OK != curl_easy_setopt (c, CURLOPT_HEADERDATA, 495 (CURLE_OK != curl_easy_setopt (c, CURLOPT_HEADERDATA,
488 hdr_chk_result)) || 496 hdr_chk_result)) ||
497#if CURL_AT_LEAST_VERSION (7, 42, 0)
489 (CURLE_OK != curl_easy_setopt (c, CURLOPT_PATH_AS_IS, 498 (CURLE_OK != curl_easy_setopt (c, CURLOPT_PATH_AS_IS,
490 (long) 1)) || 499 (long) 1)) ||
500#endif /* CURL_AT_LEAST_VERSION(7, 42, 0) */
491 (CURLE_OK != curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L)) || 501 (CURLE_OK != curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L)) ||
492 (oneone) ? 502 (oneone) ?
493 (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION, 503 (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION,