diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2021-12-12 15:01:17 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2021-12-12 16:10:28 +0300 |
commit | a08cfbe742ad15174a7b0d6cf12f53e9a686f99b (patch) | |
tree | 5610b1baacec021b1438dd48ca3b84e0c8fb9037 /src/testcurl/test_tricky.c | |
parent | 69854dc4359ae3ba16ddd65d51741bdf302d8cfb (diff) | |
download | libmicrohttpd-a08cfbe742ad15174a7b0d6cf12f53e9a686f99b.tar.gz libmicrohttpd-a08cfbe742ad15174a7b0d6cf12f53e9a686f99b.zip |
Fixed tests compatibility with old libcurl
Diffstat (limited to 'src/testcurl/test_tricky.c')
-rw-r--r-- | src/testcurl/test_tricky.c | 10 |
1 files changed, 10 insertions, 0 deletions
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, |