diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2022-01-11 21:05:39 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2022-01-12 19:15:56 +0300 |
commit | ebe0f498d85882dca93154ef9e3fc8b6c4b7127a (patch) | |
tree | 65d59649045c7de868d56cb815f09ac279faca04 | |
parent | 856d71686610e5e708ae796be1d0cd2c2c7cf579 (diff) | |
download | libmicrohttpd-ebe0f498d85882dca93154ef9e3fc8b6c4b7127a.tar.gz libmicrohttpd-ebe0f498d85882dca93154ef9e3fc8b6c4b7127a.zip |
tests: simplified libcurl HTTP settings
-rw-r--r-- | src/testcurl/test_add_conn.c | 9 | ||||
-rw-r--r-- | src/testcurl/test_get_close_keep_alive.c | 9 | ||||
-rw-r--r-- | src/testcurl/test_large_put.c | 37 | ||||
-rw-r--r-- | src/testcurl/test_toolarge.c | 9 | ||||
-rw-r--r-- | src/testcurl/test_tricky.c | 9 |
5 files changed, 33 insertions, 40 deletions
diff --git a/src/testcurl/test_add_conn.c b/src/testcurl/test_add_conn.c index 49e2c9a9..746ecbaf 100644 --- a/src/testcurl/test_add_conn.c +++ b/src/testcurl/test_add_conn.c | |||
@@ -446,11 +446,10 @@ curlEasyInitForTest (const char *queryPath, int port, struct CBC *pcbc) | |||
446 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_TIMEOUT, | 446 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_TIMEOUT, |
447 | (long) response_timeout_val)) || | 447 | (long) response_timeout_val)) || |
448 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L)) || | 448 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L)) || |
449 | ((oneone) ? | 449 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION, |
450 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION, | 450 | (oneone) ? |
451 | CURL_HTTP_VERSION_1_1)) : | 451 | CURL_HTTP_VERSION_1_1 : |
452 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION, | 452 | CURL_HTTP_VERSION_1_0))) |
453 | CURL_HTTP_VERSION_1_0)))) | ||
454 | { | 453 | { |
455 | fprintf (stderr, "curl_easy_setopt() failed.\n"); | 454 | fprintf (stderr, "curl_easy_setopt() failed.\n"); |
456 | _exit (99); | 455 | _exit (99); |
diff --git a/src/testcurl/test_get_close_keep_alive.c b/src/testcurl/test_get_close_keep_alive.c index 53911f5b..2fca0ce3 100644 --- a/src/testcurl/test_get_close_keep_alive.c +++ b/src/testcurl/test_get_close_keep_alive.c | |||
@@ -422,11 +422,10 @@ curlEasyInitForTest (const char *queryPath, int port, struct CBC *pcbc, | |||
422 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_HEADERDATA, | 422 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_HEADERDATA, |
423 | hdr_chk_result)) || | 423 | hdr_chk_result)) || |
424 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L)) || | 424 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L)) || |
425 | ((oneone) ? | 425 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION, |
426 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION, | 426 | (oneone) ? |
427 | CURL_HTTP_VERSION_1_1)) : | 427 | CURL_HTTP_VERSION_1_1 : |
428 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION, | 428 | CURL_HTTP_VERSION_1_0))) |
429 | CURL_HTTP_VERSION_1_0)))) | ||
430 | { | 429 | { |
431 | fprintf (stderr, "curl_easy_setopt() failed.\n"); | 430 | fprintf (stderr, "curl_easy_setopt() failed.\n"); |
432 | externalErrorExit (); | 431 | externalErrorExit (); |
diff --git a/src/testcurl/test_large_put.c b/src/testcurl/test_large_put.c index 9c26adbd..b00d0e1a 100644 --- a/src/testcurl/test_large_put.c +++ b/src/testcurl/test_large_put.c | |||
@@ -365,11 +365,11 @@ testPutInternalThread (unsigned int add_flag) | |||
365 | (long) 150)) || | 365 | (long) 150)) || |
366 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_TIMEOUT, | 366 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_TIMEOUT, |
367 | (long) 150)) || | 367 | (long) 150)) || |
368 | ((oneone) ? | 368 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION, |
369 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION, | 369 | (oneone) ? |
370 | CURL_HTTP_VERSION_1_1)) : | 370 | CURL_HTTP_VERSION_1_1 : |
371 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION, | 371 | CURL_HTTP_VERSION_1_0))) |
372 | CURL_HTTP_VERSION_1_0)))) | 372 | |
373 | { | 373 | { |
374 | fprintf (stderr, "curl_easy_setopt() failed.\n"); | 374 | fprintf (stderr, "curl_easy_setopt() failed.\n"); |
375 | externalErrorExit (); | 375 | externalErrorExit (); |
@@ -471,11 +471,10 @@ testPutThreadPerConn (unsigned int add_flag) | |||
471 | (long) 150)) || | 471 | (long) 150)) || |
472 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_TIMEOUT, | 472 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_TIMEOUT, |
473 | (long) 150)) || | 473 | (long) 150)) || |
474 | ((oneone) ? | 474 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION, |
475 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION, | 475 | (oneone) ? |
476 | CURL_HTTP_VERSION_1_1)) : | 476 | CURL_HTTP_VERSION_1_1 : |
477 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION, | 477 | CURL_HTTP_VERSION_1_0))) |
478 | CURL_HTTP_VERSION_1_0)))) | ||
479 | { | 478 | { |
480 | fprintf (stderr, "curl_easy_setopt() failed.\n"); | 479 | fprintf (stderr, "curl_easy_setopt() failed.\n"); |
481 | externalErrorExit (); | 480 | externalErrorExit (); |
@@ -577,11 +576,10 @@ testPutThreadPool (unsigned int add_flag) | |||
577 | (long) 150)) || | 576 | (long) 150)) || |
578 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_TIMEOUT, | 577 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_TIMEOUT, |
579 | (long) 150)) || | 578 | (long) 150)) || |
580 | ((oneone) ? | 579 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION, |
581 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION, | 580 | (oneone) ? |
582 | CURL_HTTP_VERSION_1_1)) : | 581 | CURL_HTTP_VERSION_1_1 : |
583 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION, | 582 | CURL_HTTP_VERSION_1_0))) |
584 | CURL_HTTP_VERSION_1_0)))) | ||
585 | { | 583 | { |
586 | fprintf (stderr, "curl_easy_setopt() failed.\n"); | 584 | fprintf (stderr, "curl_easy_setopt() failed.\n"); |
587 | externalErrorExit (); | 585 | externalErrorExit (); |
@@ -689,11 +687,10 @@ testPutExternal (void) | |||
689 | (long) 150)) || | 687 | (long) 150)) || |
690 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_TIMEOUT, | 688 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_TIMEOUT, |
691 | (long) 150)) || | 689 | (long) 150)) || |
692 | ((oneone) ? | 690 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION, |
693 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION, | 691 | (oneone) ? |
694 | CURL_HTTP_VERSION_1_1)) : | 692 | CURL_HTTP_VERSION_1_1 : |
695 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION, | 693 | CURL_HTTP_VERSION_1_0))) |
696 | CURL_HTTP_VERSION_1_0)))) | ||
697 | { | 694 | { |
698 | fprintf (stderr, "curl_easy_setopt() failed.\n"); | 695 | fprintf (stderr, "curl_easy_setopt() failed.\n"); |
699 | externalErrorExit (); | 696 | externalErrorExit (); |
diff --git a/src/testcurl/test_toolarge.c b/src/testcurl/test_toolarge.c index 7cbb1545..6f78d7ba 100644 --- a/src/testcurl/test_toolarge.c +++ b/src/testcurl/test_toolarge.c | |||
@@ -577,11 +577,10 @@ curlEasyInitForTest (const char *queryPath, const char *method, | |||
577 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_HEADERDATA, | 577 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_HEADERDATA, |
578 | hdr_chk_result)) || | 578 | hdr_chk_result)) || |
579 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L)) || | 579 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L)) || |
580 | ((oneone) ? | 580 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION, |
581 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION, | 581 | (oneone) ? |
582 | CURL_HTTP_VERSION_1_1)) : | 582 | CURL_HTTP_VERSION_1_1 : |
583 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION, | 583 | CURL_HTTP_VERSION_1_0))) |
584 | CURL_HTTP_VERSION_1_0)))) | ||
585 | libcurlErrorExitDesc ("curl_easy_setopt() failed"); | 584 | libcurlErrorExitDesc ("curl_easy_setopt() failed"); |
586 | 585 | ||
587 | if (CURLE_OK != curl_easy_setopt (c, CURLOPT_CUSTOMREQUEST, method)) | 586 | if (CURLE_OK != curl_easy_setopt (c, CURLOPT_CUSTOMREQUEST, method)) |
diff --git a/src/testcurl/test_tricky.c b/src/testcurl/test_tricky.c index b926884f..50af68a1 100644 --- a/src/testcurl/test_tricky.c +++ b/src/testcurl/test_tricky.c | |||
@@ -500,11 +500,10 @@ curlEasyInitForTest (struct curlQueryParams *p, | |||
500 | (long) 1)) || | 500 | (long) 1)) || |
501 | #endif /* CURL_AT_LEAST_VERSION(7, 42, 0) */ | 501 | #endif /* CURL_AT_LEAST_VERSION(7, 42, 0) */ |
502 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L)) || | 502 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L)) || |
503 | ((oneone) ? | 503 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION, |
504 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION, | 504 | (oneone) ? |
505 | CURL_HTTP_VERSION_1_1)) : | 505 | CURL_HTTP_VERSION_1_1 : |
506 | (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION, | 506 | CURL_HTTP_VERSION_1_0))) |
507 | CURL_HTTP_VERSION_1_0)))) | ||
508 | libcurlErrorExitDesc ("curl_easy_setopt() failed"); | 507 | libcurlErrorExitDesc ("curl_easy_setopt() failed"); |
509 | 508 | ||
510 | if (CURLE_OK != curl_easy_setopt (c, CURLOPT_CUSTOMREQUEST, p->method)) | 509 | if (CURLE_OK != curl_easy_setopt (c, CURLOPT_CUSTOMREQUEST, p->method)) |