mirror of
https://github.com/moparisthebest/curl
synced 2024-12-22 16:18:48 -05:00
tests: Fixed torture test for tests 1526 & 1527
This commit is contained in:
parent
42c04eb1d1
commit
c1d6158789
@ -47,7 +47,7 @@ int test(char *URL)
|
|||||||
CURL *curl = NULL;
|
CURL *curl = NULL;
|
||||||
CURLcode res = CURLE_FAILED_INIT;
|
CURLcode res = CURLE_FAILED_INIT;
|
||||||
/* http and proxy header list*/
|
/* http and proxy header list*/
|
||||||
struct curl_slist *hhl = NULL, *phl = NULL;
|
struct curl_slist *hhl = NULL, *phl = NULL, *tmp = NULL;
|
||||||
|
|
||||||
if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
|
if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
|
||||||
fprintf(stderr, "curl_global_init() failed\n");
|
fprintf(stderr, "curl_global_init() failed\n");
|
||||||
@ -62,11 +62,14 @@ int test(char *URL)
|
|||||||
|
|
||||||
hhl = curl_slist_append(hhl, "User-Agent: Http Agent");
|
hhl = curl_slist_append(hhl, "User-Agent: Http Agent");
|
||||||
phl = curl_slist_append(phl, "User-Agent: Proxy Agent");
|
phl = curl_slist_append(phl, "User-Agent: Proxy Agent");
|
||||||
phl = curl_slist_append(phl, "Expect:");
|
|
||||||
|
|
||||||
if (!hhl || !phl) {
|
if (!hhl || !phl) {
|
||||||
goto test_cleanup;
|
goto test_cleanup;
|
||||||
}
|
}
|
||||||
|
tmp = curl_slist_append(phl, "Expect:");
|
||||||
|
if (!tmp) {
|
||||||
|
goto test_cleanup;
|
||||||
|
}
|
||||||
|
phl = tmp;
|
||||||
|
|
||||||
test_setopt(curl, CURLOPT_URL, URL);
|
test_setopt(curl, CURLOPT_URL, URL);
|
||||||
test_setopt(curl, CURLOPT_PROXY, libtest_arg2);
|
test_setopt(curl, CURLOPT_PROXY, libtest_arg2);
|
||||||
|
@ -48,7 +48,7 @@ int test(char *URL)
|
|||||||
CURL *curl = NULL;
|
CURL *curl = NULL;
|
||||||
CURLcode res = CURLE_FAILED_INIT;
|
CURLcode res = CURLE_FAILED_INIT;
|
||||||
/* http header list*/
|
/* http header list*/
|
||||||
struct curl_slist *hhl = NULL;
|
struct curl_slist *hhl = NULL, *tmp = NULL;
|
||||||
|
|
||||||
if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
|
if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
|
||||||
fprintf(stderr, "curl_global_init() failed\n");
|
fprintf(stderr, "curl_global_init() failed\n");
|
||||||
@ -62,11 +62,14 @@ int test(char *URL)
|
|||||||
}
|
}
|
||||||
|
|
||||||
hhl = curl_slist_append(hhl, "User-Agent: Http Agent");
|
hhl = curl_slist_append(hhl, "User-Agent: Http Agent");
|
||||||
hhl = curl_slist_append(hhl, "Expect: 100-continue");
|
|
||||||
|
|
||||||
if (!hhl) {
|
if (!hhl) {
|
||||||
goto test_cleanup;
|
goto test_cleanup;
|
||||||
}
|
}
|
||||||
|
tmp = curl_slist_append(hhl, "Expect: 100-continue");
|
||||||
|
if (!tmp) {
|
||||||
|
goto test_cleanup;
|
||||||
|
}
|
||||||
|
hhl = tmp;
|
||||||
|
|
||||||
test_setopt(curl, CURLOPT_URL, URL);
|
test_setopt(curl, CURLOPT_URL, URL);
|
||||||
test_setopt(curl, CURLOPT_PROXY, libtest_arg2);
|
test_setopt(curl, CURLOPT_PROXY, libtest_arg2);
|
||||||
|
Loading…
Reference in New Issue
Block a user