summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-02-09 17:13:53 +0100
committerDaniel Stenberg <daniel@haxx.se>2020-02-09 17:13:53 +0100
commite21ab4ff1aecc3fccf056a658e676c23981e5672 (patch)
treec85885a4640afecf17d6e92e4df12f887619824c
parent65f9b21ef618c6fc7aa8e7729b16998d4225a4de (diff)
downloadcurl-bagder/reset-keep-altsvc-filename.tar.gz
fixup lib1908 to deal with torture betterbagder/reset-keep-altsvc-filename
-rw-r--r--tests/libtest/lib1908.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/tests/libtest/lib1908.c b/tests/libtest/lib1908.c
index 1e4a24974..bacbc9710 100644
--- a/tests/libtest/lib1908.c
+++ b/tests/libtest/lib1908.c
@@ -27,20 +27,21 @@
int test(char *URL)
{
- CURLcode ret;
+ CURLcode ret = CURLE_OK;
CURL *hnd;
start_test_timing();
curl_global_init(CURL_GLOBAL_ALL);
hnd = curl_easy_init();
- curl_easy_setopt(hnd, CURLOPT_URL, URL);
- curl_easy_setopt(hnd, CURLOPT_NOPROGRESS, 1L);
- curl_easy_setopt(hnd, CURLOPT_ALTSVC, "log/altsvc-1908");
- ret = curl_easy_perform(hnd);
- curl_easy_reset(hnd);
- curl_easy_cleanup(hnd);
-
+ if(hnd) {
+ curl_easy_setopt(hnd, CURLOPT_URL, URL);
+ curl_easy_setopt(hnd, CURLOPT_NOPROGRESS, 1L);
+ curl_easy_setopt(hnd, CURLOPT_ALTSVC, "log/altsvc-1908");
+ ret = curl_easy_perform(hnd);
+ curl_easy_reset(hnd);
+ curl_easy_cleanup(hnd);
+ }
curl_global_cleanup();
return (int)ret;
}