aboutsummaryrefslogtreecommitdiff
path: root/src/testcurl/test_tricky.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testcurl/test_tricky.c')
-rw-r--r--src/testcurl/test_tricky.c41
1 files changed, 21 insertions, 20 deletions
diff --git a/src/testcurl/test_tricky.c b/src/testcurl/test_tricky.c
index b3042f61..bca27606 100644
--- a/src/testcurl/test_tricky.c
+++ b/src/testcurl/test_tricky.c
@@ -211,7 +211,7 @@ _mhdErrorExit_func (const char *errDesc, const char *funcName, int lineNum)
211/* Global parameters */ 211/* Global parameters */
212static int verbose; /**< Be verbose */ 212static int verbose; /**< Be verbose */
213static int oneone; /**< If false use HTTP/1.0 for requests*/ 213static int oneone; /**< If false use HTTP/1.0 for requests*/
214static int global_port; /**< MHD daemons listen port number */ 214static uint16_t global_port; /**< MHD daemons listen port number */
215static int response_timeout_val = TIMEOUTS_VAL; 215static int response_timeout_val = TIMEOUTS_VAL;
216 216
217static int tricky_url; /**< Tricky request URL */ 217static int tricky_url; /**< Tricky request URL */
@@ -455,13 +455,13 @@ struct curlQueryParams
455 const char *method; 455 const char *method;
456 456
457 /* Destination port for CURL query */ 457 /* Destination port for CURL query */
458 int queryPort; 458 uint16_t queryPort;
459 459
460 /* List of additional request headers */ 460 /* List of additional request headers */
461 struct curl_slist *headers; 461 struct curl_slist *headers;
462 462
463 /* CURL query result error flag */ 463 /* CURL query result error flag */
464 volatile int queryError; 464 volatile unsigned int queryError;
465 465
466 /* Response HTTP code, zero if no response */ 466 /* Response HTTP code, zero if no response */
467 volatile int responseCode; 467 volatile int responseCode;
@@ -623,7 +623,7 @@ performQueryExternal (struct MHD_Daemon *d, CURL *c)
623 623
624 624
625/* Returns zero for successful response and non-zero for failed response */ 625/* Returns zero for successful response and non-zero for failed response */
626static int 626static unsigned int
627doCurlQueryInThread (struct MHD_Daemon *d, 627doCurlQueryInThread (struct MHD_Daemon *d,
628 struct curlQueryParams *p, 628 struct curlQueryParams *p,
629 struct headers_check_result *hdr_res, 629 struct headers_check_result *hdr_res,
@@ -722,13 +722,13 @@ doCurlQueryInThread (struct MHD_Daemon *d,
722 722
723 723
724/* Perform test queries, shut down MHD daemon, and free parameters */ 724/* Perform test queries, shut down MHD daemon, and free parameters */
725static int 725static unsigned int
726performTestQueries (struct MHD_Daemon *d, int d_port, 726performTestQueries (struct MHD_Daemon *d, uint16_t d_port,
727 struct ahc_cls_type *ahc_param, 727 struct ahc_cls_type *ahc_param,
728 struct check_uri_cls *uri_cb_param) 728 struct check_uri_cls *uri_cb_param)
729{ 729{
730 struct curlQueryParams qParam; 730 struct curlQueryParams qParam;
731 int ret = 0; /* Return value */ 731 unsigned int ret = 0; /* Return value */
732 struct headers_check_result rp_headers_check; 732 struct headers_check_result rp_headers_check;
733 struct curl_slist *curl_headers; 733 struct curl_slist *curl_headers;
734 curl_headers = NULL; 734 curl_headers = NULL;
@@ -923,7 +923,7 @@ enum testMhdPollType
923static unsigned int 923static unsigned int
924testNumThreadsForPool (enum testMhdPollType pollType) 924testNumThreadsForPool (enum testMhdPollType pollType)
925{ 925{
926 int numThreads = MHD_CPU_COUNT; 926 unsigned int numThreads = MHD_CPU_COUNT;
927 (void) pollType; /* Don't care about pollType for this test */ 927 (void) pollType; /* Don't care about pollType for this test */
928 return numThreads; /* No practical limit for non-cleanup test */ 928 return numThreads; /* No practical limit for non-cleanup test */
929} 929}
@@ -931,7 +931,7 @@ testNumThreadsForPool (enum testMhdPollType pollType)
931 931
932static struct MHD_Daemon * 932static struct MHD_Daemon *
933startTestMhdDaemon (enum testMhdThreadsType thrType, 933startTestMhdDaemon (enum testMhdThreadsType thrType,
934 enum testMhdPollType pollType, int *pport, 934 enum testMhdPollType pollType, uint16_t *pport,
935 struct ahc_cls_type **ahc_param, 935 struct ahc_cls_type **ahc_param,
936 struct check_uri_cls **uri_cb_param) 936 struct check_uri_cls **uri_cb_param)
937{ 937{
@@ -962,7 +962,7 @@ startTestMhdDaemon (enum testMhdThreadsType thrType,
962 } 962 }
963 963
964 if (testMhdThreadInternalPool != thrType) 964 if (testMhdThreadInternalPool != thrType)
965 d = MHD_start_daemon (((int) thrType) | ((int) pollType) 965 d = MHD_start_daemon (((unsigned int) thrType) | ((unsigned int) pollType)
966 | (verbose ? MHD_USE_ERROR_LOG : 0), 966 | (verbose ? MHD_USE_ERROR_LOG : 0),
967 *pport, NULL, NULL, 967 *pport, NULL, NULL,
968 &ahcCheck, *ahc_param, 968 &ahcCheck, *ahc_param,
@@ -970,7 +970,8 @@ startTestMhdDaemon (enum testMhdThreadsType thrType,
970 *uri_cb_param, 970 *uri_cb_param,
971 MHD_OPTION_END); 971 MHD_OPTION_END);
972 else 972 else
973 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | ((int) pollType) 973 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD
974 | ((unsigned int) pollType)
974 | (verbose ? MHD_USE_ERROR_LOG : 0), 975 | (verbose ? MHD_USE_ERROR_LOG : 0),
975 *pport, NULL, NULL, 976 *pport, NULL, NULL,
976 &ahcCheck, *ahc_param, 977 &ahcCheck, *ahc_param,
@@ -994,7 +995,7 @@ startTestMhdDaemon (enum testMhdThreadsType thrType,
994 fprintf (stderr, "MHD_get_daemon_info() failed.\n"); 995 fprintf (stderr, "MHD_get_daemon_info() failed.\n");
995 abort (); 996 abort ();
996 } 997 }
997 *pport = (int) dinfo->port; 998 *pport = dinfo->port;
998 if (0 == global_port) 999 if (0 == global_port)
999 global_port = *pport; /* Reuse the same port for all tests */ 1000 global_port = *pport; /* Reuse the same port for all tests */
1000 } 1001 }
@@ -1006,11 +1007,11 @@ startTestMhdDaemon (enum testMhdThreadsType thrType,
1006/* Test runners */ 1007/* Test runners */
1007 1008
1008 1009
1009static int 1010static unsigned int
1010testExternalGet (void) 1011testExternalGet (void)
1011{ 1012{
1012 struct MHD_Daemon *d; 1013 struct MHD_Daemon *d;
1013 int d_port = global_port; /* Daemon's port */ 1014 uint16_t d_port = global_port; /* Daemon's port */
1014 struct ahc_cls_type *ahc_param; 1015 struct ahc_cls_type *ahc_param;
1015 struct check_uri_cls *uri_cb_param; 1016 struct check_uri_cls *uri_cb_param;
1016 1017
@@ -1021,11 +1022,11 @@ testExternalGet (void)
1021} 1022}
1022 1023
1023 1024
1024static int 1025static unsigned int
1025testInternalGet (enum testMhdPollType pollType) 1026testInternalGet (enum testMhdPollType pollType)
1026{ 1027{
1027 struct MHD_Daemon *d; 1028 struct MHD_Daemon *d;
1028 int d_port = global_port; /* Daemon's port */ 1029 uint16_t d_port = global_port; /* Daemon's port */
1029 struct ahc_cls_type *ahc_param; 1030 struct ahc_cls_type *ahc_param;
1030 struct check_uri_cls *uri_cb_param; 1031 struct check_uri_cls *uri_cb_param;
1031 1032
@@ -1036,11 +1037,11 @@ testInternalGet (enum testMhdPollType pollType)
1036} 1037}
1037 1038
1038 1039
1039static int 1040static unsigned int
1040testMultithreadedGet (enum testMhdPollType pollType) 1041testMultithreadedGet (enum testMhdPollType pollType)
1041{ 1042{
1042 struct MHD_Daemon *d; 1043 struct MHD_Daemon *d;
1043 int d_port = global_port; /* Daemon's port */ 1044 uint16_t d_port = global_port; /* Daemon's port */
1044 struct ahc_cls_type *ahc_param; 1045 struct ahc_cls_type *ahc_param;
1045 struct check_uri_cls *uri_cb_param; 1046 struct check_uri_cls *uri_cb_param;
1046 1047
@@ -1050,11 +1051,11 @@ testMultithreadedGet (enum testMhdPollType pollType)
1050} 1051}
1051 1052
1052 1053
1053static int 1054static unsigned int
1054testMultithreadedPoolGet (enum testMhdPollType pollType) 1055testMultithreadedPoolGet (enum testMhdPollType pollType)
1055{ 1056{
1056 struct MHD_Daemon *d; 1057 struct MHD_Daemon *d;
1057 int d_port = global_port; /* Daemon's port */ 1058 uint16_t d_port = global_port; /* Daemon's port */
1058 struct ahc_cls_type *ahc_param; 1059 struct ahc_cls_type *ahc_param;
1059 struct check_uri_cls *uri_cb_param; 1060 struct check_uri_cls *uri_cb_param;
1060 1061