diff options
Diffstat (limited to 'src')
49 files changed, 603 insertions, 586 deletions
diff --git a/src/testcurl/perf_get.c b/src/testcurl/perf_get.c index a168205f..bcd5a21c 100644 --- a/src/testcurl/perf_get.c +++ b/src/testcurl/perf_get.c | |||
@@ -186,8 +186,8 @@ ahc_echo (void *cls, | |||
186 | } | 186 | } |
187 | 187 | ||
188 | 188 | ||
189 | static int | 189 | static unsigned int |
190 | testInternalGet (int port, int poll_flag) | 190 | testInternalGet (uint16_t port, uint32_t poll_flag) |
191 | { | 191 | { |
192 | struct MHD_Daemon *d; | 192 | struct MHD_Daemon *d; |
193 | CURL *c; | 193 | CURL *c; |
@@ -215,12 +215,12 @@ testInternalGet (int port, int poll_flag) | |||
215 | { | 215 | { |
216 | MHD_stop_daemon (d); return 32; | 216 | MHD_stop_daemon (d); return 32; |
217 | } | 217 | } |
218 | port = (int) dinfo->port; | 218 | port = dinfo->port; |
219 | } | 219 | } |
220 | snprintf (url, | 220 | snprintf (url, |
221 | sizeof (url), | 221 | sizeof (url), |
222 | "http://127.0.0.1:%d/hello_world", | 222 | "http://127.0.0.1:%u/hello_world", |
223 | port); | 223 | (unsigned int) port); |
224 | start_timer (); | 224 | start_timer (); |
225 | for (i = 0; i < ROUNDS; i++) | 225 | for (i = 0; i < ROUNDS; i++) |
226 | { | 226 | { |
@@ -264,8 +264,8 @@ testInternalGet (int port, int poll_flag) | |||
264 | } | 264 | } |
265 | 265 | ||
266 | 266 | ||
267 | static int | 267 | static unsigned int |
268 | testMultithreadedGet (int port, int poll_flag) | 268 | testMultithreadedGet (uint16_t port, uint32_t poll_flag) |
269 | { | 269 | { |
270 | struct MHD_Daemon *d; | 270 | struct MHD_Daemon *d; |
271 | CURL *c; | 271 | CURL *c; |
@@ -294,12 +294,12 @@ testMultithreadedGet (int port, int poll_flag) | |||
294 | { | 294 | { |
295 | MHD_stop_daemon (d); return 32; | 295 | MHD_stop_daemon (d); return 32; |
296 | } | 296 | } |
297 | port = (int) dinfo->port; | 297 | port = dinfo->port; |
298 | } | 298 | } |
299 | snprintf (url, | 299 | snprintf (url, |
300 | sizeof (url), | 300 | sizeof (url), |
301 | "http://127.0.0.1:%d/hello_world", | 301 | "http://127.0.0.1:%u/hello_world", |
302 | port); | 302 | (unsigned int) port); |
303 | start_timer (); | 303 | start_timer (); |
304 | for (i = 0; i < ROUNDS; i++) | 304 | for (i = 0; i < ROUNDS; i++) |
305 | { | 305 | { |
@@ -346,8 +346,8 @@ testMultithreadedGet (int port, int poll_flag) | |||
346 | } | 346 | } |
347 | 347 | ||
348 | 348 | ||
349 | static int | 349 | static unsigned int |
350 | testMultithreadedPoolGet (int port, int poll_flag) | 350 | testMultithreadedPoolGet (uint16_t port, uint32_t poll_flag) |
351 | { | 351 | { |
352 | struct MHD_Daemon *d; | 352 | struct MHD_Daemon *d; |
353 | CURL *c; | 353 | CURL *c; |
@@ -377,12 +377,12 @@ testMultithreadedPoolGet (int port, int poll_flag) | |||
377 | { | 377 | { |
378 | MHD_stop_daemon (d); return 32; | 378 | MHD_stop_daemon (d); return 32; |
379 | } | 379 | } |
380 | port = (int) dinfo->port; | 380 | port = dinfo->port; |
381 | } | 381 | } |
382 | snprintf (url, | 382 | snprintf (url, |
383 | sizeof (url), | 383 | sizeof (url), |
384 | "http://127.0.0.1:%d/hello_world", | 384 | "http://127.0.0.1:%u/hello_world", |
385 | port); | 385 | (unsigned int) port); |
386 | start_timer (); | 386 | start_timer (); |
387 | for (i = 0; i < ROUNDS; i++) | 387 | for (i = 0; i < ROUNDS; i++) |
388 | { | 388 | { |
@@ -426,8 +426,8 @@ testMultithreadedPoolGet (int port, int poll_flag) | |||
426 | } | 426 | } |
427 | 427 | ||
428 | 428 | ||
429 | static int | 429 | static unsigned int |
430 | testExternalGet (int port) | 430 | testExternalGet (uint16_t port) |
431 | { | 431 | { |
432 | struct MHD_Daemon *d; | 432 | struct MHD_Daemon *d; |
433 | CURL *c; | 433 | CURL *c; |
@@ -471,12 +471,12 @@ testExternalGet (int port) | |||
471 | { | 471 | { |
472 | MHD_stop_daemon (d); return 32; | 472 | MHD_stop_daemon (d); return 32; |
473 | } | 473 | } |
474 | port = (int) dinfo->port; | 474 | port = dinfo->port; |
475 | } | 475 | } |
476 | snprintf (url, | 476 | snprintf (url, |
477 | sizeof (url), | 477 | sizeof (url), |
478 | "http://127.0.0.1:%d/hello_world", | 478 | "http://127.0.0.1:%u/hello_world", |
479 | port); | 479 | (unsigned int) port); |
480 | start_timer (); | 480 | start_timer (); |
481 | multi = curl_multi_init (); | 481 | multi = curl_multi_init (); |
482 | if (multi == NULL) | 482 | if (multi == NULL) |
@@ -628,7 +628,7 @@ int | |||
628 | main (int argc, char *const *argv) | 628 | main (int argc, char *const *argv) |
629 | { | 629 | { |
630 | unsigned int errorCount = 0; | 630 | unsigned int errorCount = 0; |
631 | int port = 1130; | 631 | uint16_t port = 1130; |
632 | (void) argc; /* Unused. Silent compiler warning. */ | 632 | (void) argc; /* Unused. Silent compiler warning. */ |
633 | 633 | ||
634 | if ((NULL == argv) || (0 == argv[0])) | 634 | if ((NULL == argv) || (0 == argv[0])) |
diff --git a/src/testcurl/perf_get_concurrent.c b/src/testcurl/perf_get_concurrent.c index e0c70189..d1d396ae 100644 --- a/src/testcurl/perf_get_concurrent.c +++ b/src/testcurl/perf_get_concurrent.c | |||
@@ -224,14 +224,14 @@ do_gets (void *param) | |||
224 | int j; | 224 | int j; |
225 | pthread_t par[PAR]; | 225 | pthread_t par[PAR]; |
226 | char url[64]; | 226 | char url[64]; |
227 | int port = (int) (intptr_t) param; | 227 | uint16_t port = (uint16_t) (intptr_t) param; |
228 | char *err = NULL; | 228 | char *err = NULL; |
229 | static char pthr_err_marker[] = "pthread_create error"; | 229 | static char pthr_err_marker[] = "pthread_create error"; |
230 | 230 | ||
231 | snprintf (url, | 231 | snprintf (url, |
232 | sizeof (url), | 232 | sizeof (url), |
233 | "http://127.0.0.1:%d/hello_world", | 233 | "http://127.0.0.1:%u/hello_world", |
234 | port); | 234 | (unsigned int) port); |
235 | for (j = 0; j < PAR; j++) | 235 | for (j = 0; j < PAR; j++) |
236 | { | 236 | { |
237 | if (0 != pthread_create (&par[j], NULL, &thread_gets, (void *) url)) | 237 | if (0 != pthread_create (&par[j], NULL, &thread_gets, (void *) url)) |
@@ -253,8 +253,8 @@ do_gets (void *param) | |||
253 | } | 253 | } |
254 | 254 | ||
255 | 255 | ||
256 | static int | 256 | static unsigned int |
257 | testInternalGet (int port, int poll_flag) | 257 | testInternalGet (uint16_t port, uint32_t poll_flag) |
258 | { | 258 | { |
259 | struct MHD_Daemon *d; | 259 | struct MHD_Daemon *d; |
260 | const char *const test_desc = ((poll_flag & MHD_USE_AUTO) ? | 260 | const char *const test_desc = ((poll_flag & MHD_USE_AUTO) ? |
@@ -283,7 +283,7 @@ testInternalGet (int port, int poll_flag) | |||
283 | { | 283 | { |
284 | MHD_stop_daemon (d); return 32; | 284 | MHD_stop_daemon (d); return 32; |
285 | } | 285 | } |
286 | port = (int) dinfo->port; | 286 | port = dinfo->port; |
287 | } | 287 | } |
288 | start_timer (); | 288 | start_timer (); |
289 | ret_val = do_gets ((void *) (intptr_t) port); | 289 | ret_val = do_gets ((void *) (intptr_t) port); |
@@ -300,8 +300,8 @@ testInternalGet (int port, int poll_flag) | |||
300 | } | 300 | } |
301 | 301 | ||
302 | 302 | ||
303 | static int | 303 | static unsigned int |
304 | testMultithreadedGet (int port, int poll_flag) | 304 | testMultithreadedGet (uint16_t port, uint32_t poll_flag) |
305 | { | 305 | { |
306 | struct MHD_Daemon *d; | 306 | struct MHD_Daemon *d; |
307 | const char *const test_desc = ((poll_flag & MHD_USE_AUTO) ? | 307 | const char *const test_desc = ((poll_flag & MHD_USE_AUTO) ? |
@@ -334,7 +334,7 @@ testMultithreadedGet (int port, int poll_flag) | |||
334 | { | 334 | { |
335 | MHD_stop_daemon (d); return 32; | 335 | MHD_stop_daemon (d); return 32; |
336 | } | 336 | } |
337 | port = (int) dinfo->port; | 337 | port = dinfo->port; |
338 | } | 338 | } |
339 | start_timer (); | 339 | start_timer (); |
340 | ret_val = do_gets ((void *) (intptr_t) port); | 340 | ret_val = do_gets ((void *) (intptr_t) port); |
@@ -351,8 +351,8 @@ testMultithreadedGet (int port, int poll_flag) | |||
351 | } | 351 | } |
352 | 352 | ||
353 | 353 | ||
354 | static int | 354 | static unsigned int |
355 | testMultithreadedPoolGet (int port, int poll_flag) | 355 | testMultithreadedPoolGet (uint16_t port, uint32_t poll_flag) |
356 | { | 356 | { |
357 | struct MHD_Daemon *d; | 357 | struct MHD_Daemon *d; |
358 | const char *const test_desc = ((poll_flag & MHD_USE_AUTO) ? | 358 | const char *const test_desc = ((poll_flag & MHD_USE_AUTO) ? |
@@ -383,7 +383,7 @@ testMultithreadedPoolGet (int port, int poll_flag) | |||
383 | { | 383 | { |
384 | MHD_stop_daemon (d); return 32; | 384 | MHD_stop_daemon (d); return 32; |
385 | } | 385 | } |
386 | port = (int) dinfo->port; | 386 | port = dinfo->port; |
387 | } | 387 | } |
388 | start_timer (); | 388 | start_timer (); |
389 | ret_val = do_gets ((void *) (intptr_t) port); | 389 | ret_val = do_gets ((void *) (intptr_t) port); |
@@ -400,8 +400,8 @@ testMultithreadedPoolGet (int port, int poll_flag) | |||
400 | } | 400 | } |
401 | 401 | ||
402 | 402 | ||
403 | static int | 403 | static unsigned int |
404 | testExternalGet (int port) | 404 | testExternalGet (uint16_t port) |
405 | { | 405 | { |
406 | struct MHD_Daemon *d; | 406 | struct MHD_Daemon *d; |
407 | pthread_t pid; | 407 | pthread_t pid; |
@@ -431,7 +431,7 @@ testExternalGet (int port) | |||
431 | { | 431 | { |
432 | MHD_stop_daemon (d); return 32; | 432 | MHD_stop_daemon (d); return 32; |
433 | } | 433 | } |
434 | port = (int) dinfo->port; | 434 | port = dinfo->port; |
435 | } | 435 | } |
436 | if (0 != pthread_create (&pid, NULL, | 436 | if (0 != pthread_create (&pid, NULL, |
437 | &do_gets, (void *) (intptr_t) port)) | 437 | &do_gets, (void *) (intptr_t) port)) |
@@ -507,7 +507,7 @@ int | |||
507 | main (int argc, char *const *argv) | 507 | main (int argc, char *const *argv) |
508 | { | 508 | { |
509 | unsigned int errorCount = 0; | 509 | unsigned int errorCount = 0; |
510 | int port = 1100; | 510 | uint16_t port = 1100; |
511 | (void) argc; /* Unused. Silent compiler warning. */ | 511 | (void) argc; /* Unused. Silent compiler warning. */ |
512 | 512 | ||
513 | if ((NULL == argv) || (0 == argv[0])) | 513 | if ((NULL == argv) || (0 == argv[0])) |
diff --git a/src/testcurl/test_add_conn.c b/src/testcurl/test_add_conn.c index 085d5e69..b50b6a86 100644 --- a/src/testcurl/test_add_conn.c +++ b/src/testcurl/test_add_conn.c | |||
@@ -79,20 +79,19 @@ | |||
79 | 79 | ||
80 | /* Cleanup test: max number of concurrent daemons depending on maximum number | 80 | /* Cleanup test: max number of concurrent daemons depending on maximum number |
81 | * of open FDs. */ | 81 | * of open FDs. */ |
82 | #define CLEANUP_MAX_DAEMONS(max_fds) ( ((max_fds) < 10) ? 0 : \ | 82 | #define CLEANUP_MAX_DAEMONS(max_fds) (unsigned int) \ |
83 | ( (((max_fds) - 10) / \ | 83 | ( ((max_fds) < 10) ? \ |
84 | (CLEANUP_NUM_REQS_PER_DAEMON * 5 \ | 84 | 0 : ( (((max_fds) - 10) / (CLEANUP_NUM_REQS_PER_DAEMON * 5 + 3)) ) ) |
85 | + 3)) ) ) | ||
86 | 85 | ||
87 | #define EXPECTED_URI_BASE_PATH "/hello_world" | 86 | #define EXPECTED_URI_BASE_PATH "/hello_world" |
88 | #define EXPECTED_URI_QUERY "a=%26&b=c" | 87 | #define EXPECTED_URI_QUERY "a=%26&b=c" |
89 | #define EXPECTED_URI_FULL_PATH EXPECTED_URI_BASE_PATH "?" EXPECTED_URI_QUERY | 88 | #define EXPECTED_URI_FULL_PATH EXPECTED_URI_BASE_PATH "?" EXPECTED_URI_QUERY |
90 | 89 | ||
91 | /* Global parameters */ | 90 | /* Global parameters */ |
92 | static int oneone; /**< Use HTTP/1.1 instead of HTTP/1.0 */ | 91 | static int oneone; /**< Use HTTP/1.1 instead of HTTP/1.0 */ |
93 | static int no_listen; /**< Start MHD daemons without listen socket */ | 92 | static int no_listen; /**< Start MHD daemons without listen socket */ |
94 | static int global_port; /**< MHD daemons listen port number */ | 93 | static uint16_t global_port; /**< MHD daemons listen port number */ |
95 | static int cleanup_test; /**< Test for final cleanup */ | 94 | static int cleanup_test; /**< Test for final cleanup */ |
96 | static int slow_reply = 0; /**< Slowdown MHD replies */ | 95 | static int slow_reply = 0; /**< Slowdown MHD replies */ |
97 | static int ignore_response_errors = 0; /**< Do not fail test if CURL | 96 | static int ignore_response_errors = 0; /**< Do not fail test if CURL |
98 | returns error */ | 97 | returns error */ |
@@ -255,11 +254,11 @@ _externalErrorExit_func (const char *errDesc, const char *funcName, int lineNum) | |||
255 | 254 | ||
256 | 255 | ||
257 | /* Static const value, indicates that result value was not set yet */ | 256 | /* Static const value, indicates that result value was not set yet */ |
258 | static const int eMarker = 0xCE; | 257 | static const unsigned int eMarker = 0xCE; |
259 | 258 | ||
260 | 259 | ||
261 | static MHD_socket | 260 | static MHD_socket |
262 | createListeningSocket (int *pport) | 261 | createListeningSocket (uint16_t *pport) |
263 | { | 262 | { |
264 | MHD_socket skt; | 263 | MHD_socket skt; |
265 | struct sockaddr_in sin; | 264 | struct sockaddr_in sin; |
@@ -300,7 +299,7 @@ createListeningSocket (int *pport) | |||
300 | if (AF_INET != sin.sin_family) | 299 | if (AF_INET != sin.sin_family) |
301 | externalErrorExitDesc ("getsockname() returned wrong socket family"); | 300 | externalErrorExitDesc ("getsockname() returned wrong socket family"); |
302 | 301 | ||
303 | *pport = (int) ntohs (sin.sin_port); | 302 | *pport = ntohs (sin.sin_port); |
304 | } | 303 | } |
305 | 304 | ||
306 | return skt; | 305 | return skt; |
@@ -338,14 +337,14 @@ struct addConnParam | |||
338 | 337 | ||
339 | MHD_socket clent_sk; | 338 | MHD_socket clent_sk; |
340 | /* Non-zero indicate error */ | 339 | /* Non-zero indicate error */ |
341 | volatile int result; | 340 | volatile unsigned int result; |
342 | 341 | ||
343 | #ifdef HAVE_PTHREAD_H | 342 | #ifdef HAVE_PTHREAD_H |
344 | pthread_t addConnThread; | 343 | pthread_t addConnThread; |
345 | #endif /* HAVE_PTHREAD_H */ | 344 | #endif /* HAVE_PTHREAD_H */ |
346 | }; | 345 | }; |
347 | 346 | ||
348 | static int | 347 | static unsigned int |
349 | doAcceptAndAddConnInThread (struct addConnParam *p) | 348 | doAcceptAndAddConnInThread (struct addConnParam *p) |
350 | { | 349 | { |
351 | struct sockaddr addr; | 350 | struct sockaddr addr; |
@@ -386,7 +385,7 @@ startThreadAddConn (struct addConnParam *param) | |||
386 | } | 385 | } |
387 | 386 | ||
388 | 387 | ||
389 | static int | 388 | static unsigned int |
390 | finishThreadAddConn (struct addConnParam *param) | 389 | finishThreadAddConn (struct addConnParam *param) |
391 | { | 390 | { |
392 | struct addConnParam *result; | 391 | struct addConnParam *result; |
@@ -413,10 +412,10 @@ struct curlQueryParams | |||
413 | const char *queryPath; | 412 | const char *queryPath; |
414 | 413 | ||
415 | /* Destination port for CURL query */ | 414 | /* Destination port for CURL query */ |
416 | int queryPort; | 415 | uint16_t queryPort; |
417 | 416 | ||
418 | /* CURL query result error flag */ | 417 | /* CURL query result error flag */ |
419 | volatile int queryError; | 418 | volatile unsigned int queryError; |
420 | 419 | ||
421 | #ifdef HAVE_PTHREAD_H | 420 | #ifdef HAVE_PTHREAD_H |
422 | pthread_t queryThread; | 421 | pthread_t queryThread; |
@@ -424,7 +423,7 @@ struct curlQueryParams | |||
424 | }; | 423 | }; |
425 | 424 | ||
426 | static CURL * | 425 | static CURL * |
427 | curlEasyInitForTest (const char *queryPath, int port, struct CBC *pcbc) | 426 | curlEasyInitForTest (const char *queryPath, uint16_t port, struct CBC *pcbc) |
428 | { | 427 | { |
429 | CURL *c; | 428 | CURL *c; |
430 | 429 | ||
@@ -458,7 +457,7 @@ curlEasyInitForTest (const char *queryPath, int port, struct CBC *pcbc) | |||
458 | } | 457 | } |
459 | 458 | ||
460 | 459 | ||
461 | static int | 460 | static unsigned int |
462 | doCurlQueryInThread (struct curlQueryParams *p) | 461 | doCurlQueryInThread (struct curlQueryParams *p) |
463 | { | 462 | { |
464 | CURL *c; | 463 | CURL *c; |
@@ -539,7 +538,7 @@ startThreadCurlQuery (struct curlQueryParams *param) | |||
539 | } | 538 | } |
540 | 539 | ||
541 | 540 | ||
542 | static int | 541 | static unsigned int |
543 | finishThreadCurlQuery (struct curlQueryParams *param) | 542 | finishThreadCurlQuery (struct curlQueryParams *param) |
544 | { | 543 | { |
545 | struct curlQueryParams *result; | 544 | struct curlQueryParams *result; |
@@ -558,13 +557,13 @@ finishThreadCurlQuery (struct curlQueryParams *param) | |||
558 | 557 | ||
559 | 558 | ||
560 | /* Perform test queries and shut down MHD daemon */ | 559 | /* Perform test queries and shut down MHD daemon */ |
561 | static int | 560 | static unsigned int |
562 | performTestQueries (struct MHD_Daemon *d, int d_port) | 561 | performTestQueries (struct MHD_Daemon *d, uint16_t d_port) |
563 | { | 562 | { |
564 | struct curlQueryParams qParam; | 563 | struct curlQueryParams qParam; |
565 | struct addConnParam aParam; | 564 | struct addConnParam aParam; |
566 | int a_port; /* Additional listening socket port */ | 565 | uint16_t a_port; /* Additional listening socket port */ |
567 | int ret = 0; /* Return value */ | 566 | unsigned int ret = 0; /* Return value */ |
568 | 567 | ||
569 | qParam.queryPath = "http://127.0.0.1" EXPECTED_URI_FULL_PATH; | 568 | qParam.queryPath = "http://127.0.0.1" EXPECTED_URI_FULL_PATH; |
570 | a_port = 0; /* auto-assign */ | 569 | a_port = 0; /* auto-assign */ |
@@ -603,16 +602,16 @@ performTestQueries (struct MHD_Daemon *d, int d_port) | |||
603 | 602 | ||
604 | 603 | ||
605 | /* Perform test for cleanup and shutdown MHD daemon */ | 604 | /* Perform test for cleanup and shutdown MHD daemon */ |
606 | static int | 605 | static unsigned int |
607 | performTestCleanup (struct MHD_Daemon *d, int num_queries) | 606 | performTestCleanup (struct MHD_Daemon *d, unsigned int num_queries) |
608 | { | 607 | { |
609 | struct curlQueryParams *qParamList; | 608 | struct curlQueryParams *qParamList; |
610 | struct addConnParam aParam; | 609 | struct addConnParam aParam; |
611 | MHD_socket lstn_sk; /* Additional listening socket */ | 610 | MHD_socket lstn_sk; /* Additional listening socket */ |
612 | MHD_socket *clntSkList; | 611 | MHD_socket *clntSkList; |
613 | int a_port; /* Additional listening socket port */ | 612 | uint16_t a_port; /* Additional listening socket port */ |
614 | int i; | 613 | unsigned int i; |
615 | int ret = 0; /* Return value */ | 614 | unsigned int ret = 0; /* Return value */ |
616 | 615 | ||
617 | a_port = 0; /* auto-assign */ | 616 | a_port = 0; /* auto-assign */ |
618 | 617 | ||
@@ -703,7 +702,7 @@ enum testMhdPollType | |||
703 | static unsigned int | 702 | static unsigned int |
704 | testNumThreadsForPool (enum testMhdPollType pollType) | 703 | testNumThreadsForPool (enum testMhdPollType pollType) |
705 | { | 704 | { |
706 | int numThreads = MHD_CPU_COUNT; | 705 | unsigned int numThreads = MHD_CPU_COUNT; |
707 | if (! cleanup_test) | 706 | if (! cleanup_test) |
708 | return numThreads; /* No practical limit for non-cleanup test */ | 707 | return numThreads; /* No practical limit for non-cleanup test */ |
709 | if (CLEANUP_MAX_DAEMONS (sys_max_fds) < numThreads) | 708 | if (CLEANUP_MAX_DAEMONS (sys_max_fds) < numThreads) |
@@ -720,7 +719,7 @@ testNumThreadsForPool (enum testMhdPollType pollType) | |||
720 | 719 | ||
721 | static struct MHD_Daemon * | 720 | static struct MHD_Daemon * |
722 | startTestMhdDaemon (enum testMhdThreadsType thrType, | 721 | startTestMhdDaemon (enum testMhdThreadsType thrType, |
723 | enum testMhdPollType pollType, int *pport) | 722 | enum testMhdPollType pollType, uint16_t *pport) |
724 | { | 723 | { |
725 | struct MHD_Daemon *d; | 724 | struct MHD_Daemon *d; |
726 | const union MHD_DaemonInfo *dinfo; | 725 | const union MHD_DaemonInfo *dinfo; |
@@ -738,7 +737,7 @@ startTestMhdDaemon (enum testMhdThreadsType thrType, | |||
738 | } | 737 | } |
739 | 738 | ||
740 | if (testMhdThreadInternalPool != thrType) | 739 | if (testMhdThreadInternalPool != thrType) |
741 | d = MHD_start_daemon (((int) thrType) | ((int) pollType) | 740 | d = MHD_start_daemon (((unsigned int) thrType) | ((unsigned int) pollType) |
742 | | (thrType == testMhdThreadExternal ? | 741 | | (thrType == testMhdThreadExternal ? |
743 | 0 : MHD_USE_ITC) | 742 | 0 : MHD_USE_ITC) |
744 | | (no_listen ? MHD_USE_NO_LISTEN_SOCKET : 0) | 743 | | (no_listen ? MHD_USE_NO_LISTEN_SOCKET : 0) |
@@ -748,7 +747,8 @@ startTestMhdDaemon (enum testMhdThreadsType thrType, | |||
748 | MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, | 747 | MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, |
749 | MHD_OPTION_END); | 748 | MHD_OPTION_END); |
750 | else | 749 | else |
751 | d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | ((int) pollType) | 750 | d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD |
751 | | ((unsigned int) pollType) | ||
752 | | MHD_USE_ITC | 752 | | MHD_USE_ITC |
753 | | (no_listen ? MHD_USE_NO_LISTEN_SOCKET : 0) | 753 | | (no_listen ? MHD_USE_NO_LISTEN_SOCKET : 0) |
754 | | MHD_USE_ERROR_LOG, | 754 | | MHD_USE_ERROR_LOG, |
@@ -773,7 +773,7 @@ startTestMhdDaemon (enum testMhdThreadsType thrType, | |||
773 | fprintf (stderr, "MHD_get_daemon_info() failed.\n"); | 773 | fprintf (stderr, "MHD_get_daemon_info() failed.\n"); |
774 | abort (); | 774 | abort (); |
775 | } | 775 | } |
776 | *pport = (int) dinfo->port; | 776 | *pport = dinfo->port; |
777 | } | 777 | } |
778 | 778 | ||
779 | return d; | 779 | return d; |
@@ -783,7 +783,7 @@ startTestMhdDaemon (enum testMhdThreadsType thrType, | |||
783 | /* Test runners */ | 783 | /* Test runners */ |
784 | 784 | ||
785 | 785 | ||
786 | static int | 786 | static unsigned int |
787 | testExternalGet (void) | 787 | testExternalGet (void) |
788 | { | 788 | { |
789 | struct MHD_Daemon *d; | 789 | struct MHD_Daemon *d; |
@@ -796,10 +796,10 @@ testExternalGet (void) | |||
796 | CURLM *multi; | 796 | CURLM *multi; |
797 | time_t start; | 797 | time_t start; |
798 | struct timeval tv; | 798 | struct timeval tv; |
799 | int d_port = global_port; /* Daemon's port */ | 799 | uint16_t d_port = global_port; /* Daemon's port */ |
800 | int a_port = 0; /* Additional listening socket port */ | 800 | uint16_t a_port = 0; /* Additional listening socket port */ |
801 | struct addConnParam aParam; | 801 | struct addConnParam aParam; |
802 | int ret = 0; /* Return value of the test */ | 802 | unsigned int ret = 0; /* Return value of the test */ |
803 | const int c_no_listen = no_listen; /* Local const value to mute analyzer */ | 803 | const int c_no_listen = no_listen; /* Local const value to mute analyzer */ |
804 | 804 | ||
805 | d = startTestMhdDaemon (testMhdThreadExternal, testMhdPollBySelect, &d_port); | 805 | d = startTestMhdDaemon (testMhdThreadExternal, testMhdPollBySelect, &d_port); |
@@ -993,11 +993,11 @@ testExternalGet (void) | |||
993 | 993 | ||
994 | 994 | ||
995 | #ifdef HAVE_PTHREAD_H | 995 | #ifdef HAVE_PTHREAD_H |
996 | static int | 996 | static unsigned int |
997 | testInternalGet (enum testMhdPollType pollType) | 997 | testInternalGet (enum testMhdPollType pollType) |
998 | { | 998 | { |
999 | struct MHD_Daemon *d; | 999 | struct MHD_Daemon *d; |
1000 | int d_port = global_port; /* Daemon's port */ | 1000 | uint16_t d_port = global_port; /* Daemon's port */ |
1001 | 1001 | ||
1002 | d = startTestMhdDaemon (testMhdThreadInternal, pollType, | 1002 | d = startTestMhdDaemon (testMhdThreadInternal, pollType, |
1003 | &d_port); | 1003 | &d_port); |
@@ -1008,11 +1008,11 @@ testInternalGet (enum testMhdPollType pollType) | |||
1008 | } | 1008 | } |
1009 | 1009 | ||
1010 | 1010 | ||
1011 | static int | 1011 | static unsigned int |
1012 | testMultithreadedGet (enum testMhdPollType pollType) | 1012 | testMultithreadedGet (enum testMhdPollType pollType) |
1013 | { | 1013 | { |
1014 | struct MHD_Daemon *d; | 1014 | struct MHD_Daemon *d; |
1015 | int d_port = global_port; /* Daemon's port */ | 1015 | uint16_t d_port = global_port; /* Daemon's port */ |
1016 | 1016 | ||
1017 | d = startTestMhdDaemon (testMhdThreadInternalPerConnection, pollType, | 1017 | d = startTestMhdDaemon (testMhdThreadInternalPerConnection, pollType, |
1018 | &d_port); | 1018 | &d_port); |
@@ -1025,11 +1025,11 @@ testMultithreadedGet (enum testMhdPollType pollType) | |||
1025 | } | 1025 | } |
1026 | 1026 | ||
1027 | 1027 | ||
1028 | static int | 1028 | static unsigned int |
1029 | testMultithreadedPoolGet (enum testMhdPollType pollType) | 1029 | testMultithreadedPoolGet (enum testMhdPollType pollType) |
1030 | { | 1030 | { |
1031 | struct MHD_Daemon *d; | 1031 | struct MHD_Daemon *d; |
1032 | int d_port = global_port; /* Daemon's port */ | 1032 | uint16_t d_port = global_port; /* Daemon's port */ |
1033 | 1033 | ||
1034 | d = startTestMhdDaemon (testMhdThreadInternalPool, pollType, | 1034 | d = startTestMhdDaemon (testMhdThreadInternalPool, pollType, |
1035 | &d_port); | 1035 | &d_port); |
@@ -1041,17 +1041,17 @@ testMultithreadedPoolGet (enum testMhdPollType pollType) | |||
1041 | } | 1041 | } |
1042 | 1042 | ||
1043 | 1043 | ||
1044 | static int | 1044 | static unsigned int |
1045 | testStopRace (enum testMhdPollType pollType) | 1045 | testStopRace (enum testMhdPollType pollType) |
1046 | { | 1046 | { |
1047 | struct MHD_Daemon *d; | 1047 | struct MHD_Daemon *d; |
1048 | int d_port = global_port; /* Daemon's port */ | 1048 | uint16_t d_port = global_port; /* Daemon's port */ |
1049 | int a_port = 0; /* Additional listening socket port */ | 1049 | uint16_t a_port = 0; /* Additional listening socket port */ |
1050 | struct sockaddr_in sin; | 1050 | struct sockaddr_in sin; |
1051 | MHD_socket fd1; | 1051 | MHD_socket fd1; |
1052 | MHD_socket fd2; | 1052 | MHD_socket fd2; |
1053 | struct addConnParam aParam; | 1053 | struct addConnParam aParam; |
1054 | int ret = 0; /* Return value of the test */ | 1054 | unsigned int ret = 0; /* Return value of the test */ |
1055 | 1055 | ||
1056 | d = startTestMhdDaemon (testMhdThreadInternal, pollType, | 1056 | d = startTestMhdDaemon (testMhdThreadInternal, pollType, |
1057 | &d_port); | 1057 | &d_port); |
diff --git a/src/testcurl/test_basicauth.c b/src/testcurl/test_basicauth.c index f9ce2455..333ccfee 100644 --- a/src/testcurl/test_basicauth.c +++ b/src/testcurl/test_basicauth.c | |||
@@ -426,7 +426,7 @@ ahc_echo (void *cls, | |||
426 | 426 | ||
427 | 427 | ||
428 | static CURL * | 428 | static CURL * |
429 | setupCURL (void *cbc, int port, char *errbuf) | 429 | setupCURL (void *cbc, uint16_t port, char *errbuf) |
430 | { | 430 | { |
431 | CURL *c; | 431 | CURL *c; |
432 | char url[512]; | 432 | char url[512]; |
@@ -437,7 +437,8 @@ setupCURL (void *cbc, int port, char *errbuf) | |||
437 | /* A workaround for some old libcurl versions, which ignore the specified | 437 | /* A workaround for some old libcurl versions, which ignore the specified |
438 | * port by CURLOPT_PORT when authorisation is used. */ | 438 | * port by CURLOPT_PORT when authorisation is used. */ |
439 | res = snprintf (url, (sizeof(url) / sizeof(url[0])), | 439 | res = snprintf (url, (sizeof(url) / sizeof(url[0])), |
440 | "http://127.0.0.1:%d%s", port, MHD_URI_BASE_PATH); | 440 | "http://127.0.0.1:%u%s", (unsigned int) port, |
441 | MHD_URI_BASE_PATH); | ||
441 | if ((0 >= res) || ((sizeof(url) / sizeof(url[0])) <= (size_t) res)) | 442 | if ((0 >= res) || ((sizeof(url) / sizeof(url[0])) <= (size_t) res)) |
442 | externalErrorExitDesc ("Cannot form request URL"); | 443 | externalErrorExitDesc ("Cannot form request URL"); |
443 | } | 444 | } |
diff --git a/src/testcurl/test_callback.c b/src/testcurl/test_callback.c index 8b23ed02..49b11e36 100644 --- a/src/testcurl/test_callback.c +++ b/src/testcurl/test_callback.c | |||
@@ -47,7 +47,7 @@ called_twice (void *cls, uint64_t pos, char *buf, size_t max) | |||
47 | { | 47 | { |
48 | memcpy (buf, "test", 5); | 48 | memcpy (buf, "test", 5); |
49 | cls2->called = 1; | 49 | cls2->called = 1; |
50 | return strlen (buf); | 50 | return (ssize_t) strlen (buf); |
51 | } | 51 | } |
52 | if (cls2->called == 1) | 52 | if (cls2->called == 1) |
53 | { | 53 | { |
@@ -132,7 +132,7 @@ main (int argc, char **argv) | |||
132 | int running; | 132 | int running; |
133 | struct timeval tv; | 133 | struct timeval tv; |
134 | int extra; | 134 | int extra; |
135 | int port; | 135 | uint16_t port; |
136 | (void) argc; (void) argv; /* Unused. Silent compiler warning. */ | 136 | (void) argc; (void) argv; /* Unused. Silent compiler warning. */ |
137 | 137 | ||
138 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 138 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
@@ -157,7 +157,7 @@ main (int argc, char **argv) | |||
157 | { | 157 | { |
158 | MHD_stop_daemon (d); return 48; | 158 | MHD_stop_daemon (d); return 48; |
159 | } | 159 | } |
160 | port = (int) dinfo->port; | 160 | port = dinfo->port; |
161 | } | 161 | } |
162 | c = curl_easy_init (); | 162 | c = curl_easy_init (); |
163 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/"); | 163 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/"); |
diff --git a/src/testcurl/test_concurrent_stop.c b/src/testcurl/test_concurrent_stop.c index 80b49ed7..dec0d269 100644 --- a/src/testcurl/test_concurrent_stop.c +++ b/src/testcurl/test_concurrent_stop.c | |||
@@ -216,12 +216,12 @@ do_gets (void *param) | |||
216 | int j; | 216 | int j; |
217 | pthread_t par[PAR]; | 217 | pthread_t par[PAR]; |
218 | char url[64]; | 218 | char url[64]; |
219 | int port = (int) (intptr_t) param; | 219 | uint16_t port = (uint16_t) (intptr_t) param; |
220 | 220 | ||
221 | snprintf (url, | 221 | snprintf (url, |
222 | sizeof (url), | 222 | sizeof (url), |
223 | "http://127.0.0.1:%d/hello_world", | 223 | "http://127.0.0.1:%u/hello_world", |
224 | port); | 224 | (unsigned int) port); |
225 | 225 | ||
226 | for (j = 0; j < PAR; j++) | 226 | for (j = 0; j < PAR; j++) |
227 | { | 227 | { |
@@ -246,7 +246,7 @@ do_gets (void *param) | |||
246 | 246 | ||
247 | 247 | ||
248 | static pthread_t | 248 | static pthread_t |
249 | start_gets (int port) | 249 | start_gets (uint16_t port) |
250 | { | 250 | { |
251 | pthread_t tid; | 251 | pthread_t tid; |
252 | continue_requesting = 1; | 252 | continue_requesting = 1; |
@@ -259,18 +259,18 @@ start_gets (int port) | |||
259 | } | 259 | } |
260 | 260 | ||
261 | 261 | ||
262 | static int | 262 | static unsigned int |
263 | testMultithreadedGet (int port, | 263 | testMultithreadedGet (uint16_t port, |
264 | int poll_flag) | 264 | uint32_t poll_flag) |
265 | { | 265 | { |
266 | struct MHD_Daemon *d; | 266 | struct MHD_Daemon *d; |
267 | pthread_t p; | 267 | pthread_t p; |
268 | int result; | 268 | unsigned int result; |
269 | 269 | ||
270 | result = 0; | 270 | result = 0; |
271 | d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 271 | d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION |
272 | | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | 272 | | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG |
273 | | poll_flag, | 273 | | (enum MHD_FLAG) poll_flag, |
274 | port, | 274 | port, |
275 | NULL, NULL, | 275 | NULL, NULL, |
276 | &ahc_echo, NULL, | 276 | &ahc_echo, NULL, |
@@ -285,7 +285,7 @@ testMultithreadedGet (int port, | |||
285 | { | 285 | { |
286 | MHD_stop_daemon (d); return 32; | 286 | MHD_stop_daemon (d); return 32; |
287 | } | 287 | } |
288 | port = (int) dinfo->port; | 288 | port = dinfo->port; |
289 | } | 289 | } |
290 | client_error = CURLE_OK; /* clear client error state */ | 290 | client_error = CURLE_OK; /* clear client error state */ |
291 | p = start_gets (port); | 291 | p = start_gets (port); |
@@ -305,17 +305,17 @@ testMultithreadedGet (int port, | |||
305 | } | 305 | } |
306 | 306 | ||
307 | 307 | ||
308 | static int | 308 | static unsigned int |
309 | testMultithreadedPoolGet (int port, | 309 | testMultithreadedPoolGet (uint16_t port, |
310 | int poll_flag) | 310 | uint32_t poll_flag) |
311 | { | 311 | { |
312 | struct MHD_Daemon *d; | 312 | struct MHD_Daemon *d; |
313 | pthread_t p; | 313 | pthread_t p; |
314 | int result; | 314 | unsigned int result; |
315 | 315 | ||
316 | result = 0; | 316 | result = 0; |
317 | d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | 317 | d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG |
318 | | poll_flag, | 318 | | (enum MHD_FLAG) poll_flag, |
319 | port, | 319 | port, |
320 | NULL, NULL, | 320 | NULL, NULL, |
321 | &ahc_echo, NULL, | 321 | &ahc_echo, NULL, |
@@ -331,7 +331,7 @@ testMultithreadedPoolGet (int port, | |||
331 | { | 331 | { |
332 | MHD_stop_daemon (d); return 32; | 332 | MHD_stop_daemon (d); return 32; |
333 | } | 333 | } |
334 | port = (int) dinfo->port; | 334 | port = dinfo->port; |
335 | } | 335 | } |
336 | client_error = CURLE_OK; /* clear client error state */ | 336 | client_error = CURLE_OK; /* clear client error state */ |
337 | p = start_gets (port); | 337 | p = start_gets (port); |
@@ -355,7 +355,7 @@ int | |||
355 | main (int argc, char *const *argv) | 355 | main (int argc, char *const *argv) |
356 | { | 356 | { |
357 | unsigned int errorCount = 0; | 357 | unsigned int errorCount = 0; |
358 | int port; | 358 | uint16_t port; |
359 | (void) argc; /* Unused. Silent compiler warning. */ | 359 | (void) argc; /* Unused. Silent compiler warning. */ |
360 | (void) argv; /* Unused. Silent compiler warning. */ | 360 | (void) argv; /* Unused. Silent compiler warning. */ |
361 | 361 | ||
diff --git a/src/testcurl/test_delete.c b/src/testcurl/test_delete.c index 07af82e5..442d4397 100644 --- a/src/testcurl/test_delete.c +++ b/src/testcurl/test_delete.c | |||
@@ -58,8 +58,8 @@ struct CBC | |||
58 | static size_t | 58 | static size_t |
59 | putBuffer (void *stream, size_t size, size_t nmemb, void *ptr) | 59 | putBuffer (void *stream, size_t size, size_t nmemb, void *ptr) |
60 | { | 60 | { |
61 | unsigned int *pos = ptr; | 61 | size_t *pos = ptr; |
62 | unsigned int wrt; | 62 | size_t wrt; |
63 | 63 | ||
64 | wrt = size * nmemb; | 64 | wrt = size * nmemb; |
65 | if (wrt > 8 - (*pos)) | 65 | if (wrt > 8 - (*pos)) |
@@ -123,17 +123,17 @@ ahc_echo (void *cls, | |||
123 | } | 123 | } |
124 | 124 | ||
125 | 125 | ||
126 | static int | 126 | static unsigned int |
127 | testInternalDelete (void) | 127 | testInternalDelete (void) |
128 | { | 128 | { |
129 | struct MHD_Daemon *d; | 129 | struct MHD_Daemon *d; |
130 | CURL *c; | 130 | CURL *c; |
131 | char buf[2048]; | 131 | char buf[2048]; |
132 | struct CBC cbc; | 132 | struct CBC cbc; |
133 | unsigned int pos = 0; | 133 | size_t pos = 0; |
134 | int done_flag = 0; | 134 | int done_flag = 0; |
135 | CURLcode errornum; | 135 | CURLcode errornum; |
136 | int port; | 136 | uint16_t port; |
137 | 137 | ||
138 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 138 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
139 | port = 0; | 139 | port = 0; |
@@ -156,7 +156,7 @@ testInternalDelete (void) | |||
156 | { | 156 | { |
157 | MHD_stop_daemon (d); return 32; | 157 | MHD_stop_daemon (d); return 32; |
158 | } | 158 | } |
159 | port = (int) dinfo->port; | 159 | port = dinfo->port; |
160 | } | 160 | } |
161 | c = curl_easy_init (); | 161 | c = curl_easy_init (); |
162 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); | 162 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); |
@@ -198,17 +198,17 @@ testInternalDelete (void) | |||
198 | } | 198 | } |
199 | 199 | ||
200 | 200 | ||
201 | static int | 201 | static unsigned int |
202 | testMultithreadedDelete (void) | 202 | testMultithreadedDelete (void) |
203 | { | 203 | { |
204 | struct MHD_Daemon *d; | 204 | struct MHD_Daemon *d; |
205 | CURL *c; | 205 | CURL *c; |
206 | char buf[2048]; | 206 | char buf[2048]; |
207 | struct CBC cbc; | 207 | struct CBC cbc; |
208 | unsigned int pos = 0; | 208 | size_t pos = 0; |
209 | int done_flag = 0; | 209 | int done_flag = 0; |
210 | CURLcode errornum; | 210 | CURLcode errornum; |
211 | int port; | 211 | uint16_t port; |
212 | 212 | ||
213 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 213 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
214 | port = 0; | 214 | port = 0; |
@@ -232,7 +232,7 @@ testMultithreadedDelete (void) | |||
232 | { | 232 | { |
233 | MHD_stop_daemon (d); return 32; | 233 | MHD_stop_daemon (d); return 32; |
234 | } | 234 | } |
235 | port = (int) dinfo->port; | 235 | port = dinfo->port; |
236 | } | 236 | } |
237 | c = curl_easy_init (); | 237 | c = curl_easy_init (); |
238 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); | 238 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); |
@@ -275,17 +275,17 @@ testMultithreadedDelete (void) | |||
275 | } | 275 | } |
276 | 276 | ||
277 | 277 | ||
278 | static int | 278 | static unsigned int |
279 | testMultithreadedPoolDelete (void) | 279 | testMultithreadedPoolDelete (void) |
280 | { | 280 | { |
281 | struct MHD_Daemon *d; | 281 | struct MHD_Daemon *d; |
282 | CURL *c; | 282 | CURL *c; |
283 | char buf[2048]; | 283 | char buf[2048]; |
284 | struct CBC cbc; | 284 | struct CBC cbc; |
285 | unsigned int pos = 0; | 285 | size_t pos = 0; |
286 | int done_flag = 0; | 286 | int done_flag = 0; |
287 | CURLcode errornum; | 287 | CURLcode errornum; |
288 | int port; | 288 | uint16_t port; |
289 | 289 | ||
290 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 290 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
291 | port = 0; | 291 | port = 0; |
@@ -310,7 +310,7 @@ testMultithreadedPoolDelete (void) | |||
310 | { | 310 | { |
311 | MHD_stop_daemon (d); return 32; | 311 | MHD_stop_daemon (d); return 32; |
312 | } | 312 | } |
313 | port = (int) dinfo->port; | 313 | port = dinfo->port; |
314 | } | 314 | } |
315 | c = curl_easy_init (); | 315 | c = curl_easy_init (); |
316 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); | 316 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); |
@@ -353,7 +353,7 @@ testMultithreadedPoolDelete (void) | |||
353 | } | 353 | } |
354 | 354 | ||
355 | 355 | ||
356 | static int | 356 | static unsigned int |
357 | testExternalDelete (void) | 357 | testExternalDelete (void) |
358 | { | 358 | { |
359 | struct MHD_Daemon *d; | 359 | struct MHD_Daemon *d; |
@@ -375,9 +375,9 @@ testExternalDelete (void) | |||
375 | struct CURLMsg *msg; | 375 | struct CURLMsg *msg; |
376 | time_t start; | 376 | time_t start; |
377 | struct timeval tv; | 377 | struct timeval tv; |
378 | unsigned int pos = 0; | 378 | size_t pos = 0; |
379 | int done_flag = 0; | 379 | int done_flag = 0; |
380 | int port; | 380 | uint16_t port; |
381 | 381 | ||
382 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 382 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
383 | port = 0; | 383 | port = 0; |
@@ -401,7 +401,7 @@ testExternalDelete (void) | |||
401 | { | 401 | { |
402 | MHD_stop_daemon (d); return 32; | 402 | MHD_stop_daemon (d); return 32; |
403 | } | 403 | } |
404 | port = (int) dinfo->port; | 404 | port = dinfo->port; |
405 | } | 405 | } |
406 | c = curl_easy_init (); | 406 | c = curl_easy_init (); |
407 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); | 407 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); |
diff --git a/src/testcurl/test_digestauth.c b/src/testcurl/test_digestauth.c index adc5f330..3388ffbc 100644 --- a/src/testcurl/test_digestauth.c +++ b/src/testcurl/test_digestauth.c | |||
@@ -349,7 +349,8 @@ setupCURL (void *cbc, uint16_t port) | |||
349 | /* A workaround for some old libcurl versions, which ignore the specified | 349 | /* A workaround for some old libcurl versions, which ignore the specified |
350 | * port by CURLOPT_PORT when digest authorisation is used. */ | 350 | * port by CURLOPT_PORT when digest authorisation is used. */ |
351 | res = snprintf (url, (sizeof(url) / sizeof(url[0])), | 351 | res = snprintf (url, (sizeof(url) / sizeof(url[0])), |
352 | "http://127.0.0.1:%d%s", (int) port, MHD_URI_BASE_PATH); | 352 | "http://127.0.0.1:%u%s", |
353 | (unsigned int) port, MHD_URI_BASE_PATH); | ||
353 | if ((0 >= res) || ((sizeof(url) / sizeof(url[0])) <= (size_t) res)) | 354 | if ((0 >= res) || ((sizeof(url) / sizeof(url[0])) <= (size_t) res)) |
354 | externalErrorExitDesc ("Cannot form request URL"); | 355 | externalErrorExitDesc ("Cannot form request URL"); |
355 | } | 356 | } |
@@ -419,9 +420,9 @@ testDigestAuth (void) | |||
419 | 420 | ||
420 | while (off < 8) | 421 | while (off < 8) |
421 | { | 422 | { |
422 | len = read (fd, | 423 | len = (size_t) read (fd, |
423 | rnd + off, | 424 | rnd + off, |
424 | 8 - off); | 425 | 8 - off); |
425 | if (len == (size_t) -1) | 426 | if (len == (size_t) -1) |
426 | externalErrorExitDesc ("Failed to read '/dev/urandom'"); | 427 | externalErrorExitDesc ("Failed to read '/dev/urandom'"); |
427 | off += len; | 428 | off += len; |
diff --git a/src/testcurl/test_digestauth2.c b/src/testcurl/test_digestauth2.c index ab8d2b07..a1a2a700 100644 --- a/src/testcurl/test_digestauth2.c +++ b/src/testcurl/test_digestauth2.c | |||
@@ -1098,7 +1098,7 @@ ahc_echo (void *cls, | |||
1098 | * @param uri_num the number of URI, should be 0, 1 or 2 | 1098 | * @param uri_num the number of URI, should be 0, 1 or 2 |
1099 | */ | 1099 | */ |
1100 | static void | 1100 | static void |
1101 | setCURL_rq_path (CURL *c, unsigned int port, unsigned int uri_num) | 1101 | setCURL_rq_path (CURL *c, uint16_t port, unsigned int uri_num) |
1102 | { | 1102 | { |
1103 | const char *req_path; | 1103 | const char *req_path; |
1104 | char uri[512]; | 1104 | char uri[512]; |
@@ -1113,7 +1113,7 @@ setCURL_rq_path (CURL *c, unsigned int port, unsigned int uri_num) | |||
1113 | /* A workaround for some old libcurl versions, which ignore the specified | 1113 | /* A workaround for some old libcurl versions, which ignore the specified |
1114 | * port by CURLOPT_PORT when authorisation is used. */ | 1114 | * port by CURLOPT_PORT when authorisation is used. */ |
1115 | res = snprintf (uri, (sizeof(uri) / sizeof(uri[0])), | 1115 | res = snprintf (uri, (sizeof(uri) / sizeof(uri[0])), |
1116 | "http://127.0.0.1:%u%s", port, | 1116 | "http://127.0.0.1:%u%s", (unsigned int) port, |
1117 | req_path); | 1117 | req_path); |
1118 | if ((0 >= res) || ((sizeof(uri) / sizeof(uri[0])) <= (size_t) res)) | 1118 | if ((0 >= res) || ((sizeof(uri) / sizeof(uri[0])) <= (size_t) res)) |
1119 | externalErrorExitDesc ("Cannot form request URL"); | 1119 | externalErrorExitDesc ("Cannot form request URL"); |
@@ -1124,7 +1124,7 @@ setCURL_rq_path (CURL *c, unsigned int port, unsigned int uri_num) | |||
1124 | 1124 | ||
1125 | 1125 | ||
1126 | static CURL * | 1126 | static CURL * |
1127 | setupCURL (void *cbc, unsigned int port) | 1127 | setupCURL (void *cbc, uint16_t port) |
1128 | { | 1128 | { |
1129 | CURL *c; | 1129 | CURL *c; |
1130 | 1130 | ||
@@ -1394,7 +1394,7 @@ testDigestAuth (void) | |||
1394 | cbc.size = sizeof (buf); | 1394 | cbc.size = sizeof (buf); |
1395 | cbc.pos = 0; | 1395 | cbc.pos = 0; |
1396 | memset (cbc.buf, 0, cbc.size); | 1396 | memset (cbc.buf, 0, cbc.size); |
1397 | c = setupCURL (&cbc, (unsigned int) port); | 1397 | c = setupCURL (&cbc, port); |
1398 | multi_reuse = NULL; | 1398 | multi_reuse = NULL; |
1399 | /* First request */ | 1399 | /* First request */ |
1400 | if (check_result (performQueryExternal (d, c, &multi_reuse), c, &cbc)) | 1400 | if (check_result (performQueryExternal (d, c, &multi_reuse), c, &cbc)) |
diff --git a/src/testcurl/test_digestauth_concurrent.c b/src/testcurl/test_digestauth_concurrent.c index 792d15de..e7789cbe 100644 --- a/src/testcurl/test_digestauth_concurrent.c +++ b/src/testcurl/test_digestauth_concurrent.c | |||
@@ -361,7 +361,8 @@ setupCURL (void *cbc, uint16_t port, char *errbuf) | |||
361 | /* A workaround for some old libcurl versions, which ignore the specified | 361 | /* A workaround for some old libcurl versions, which ignore the specified |
362 | * port by CURLOPT_PORT when digest authorisation is used. */ | 362 | * port by CURLOPT_PORT when digest authorisation is used. */ |
363 | res = snprintf (url, (sizeof(url) / sizeof(url[0])), | 363 | res = snprintf (url, (sizeof(url) / sizeof(url[0])), |
364 | "http://127.0.0.1:%d%s", (int) port, MHD_URI_BASE_PATH); | 364 | "http://127.0.0.1:%u%s", (unsigned int) port, |
365 | MHD_URI_BASE_PATH); | ||
365 | if ((0 >= res) || ((sizeof(url) / sizeof(url[0])) <= (size_t) res)) | 366 | if ((0 >= res) || ((sizeof(url) / sizeof(url[0])) <= (size_t) res)) |
366 | externalErrorExitDesc ("Cannot form request URL"); | 367 | externalErrorExitDesc ("Cannot form request URL"); |
367 | } | 368 | } |
diff --git a/src/testcurl/test_digestauth_emu_ext.c b/src/testcurl/test_digestauth_emu_ext.c index 10e04477..e10944c7 100644 --- a/src/testcurl/test_digestauth_emu_ext.c +++ b/src/testcurl/test_digestauth_emu_ext.c | |||
@@ -599,7 +599,7 @@ ahc_echo (void *cls, | |||
599 | 599 | ||
600 | 600 | ||
601 | static CURL * | 601 | static CURL * |
602 | setupCURL (void *cbc, int port) | 602 | setupCURL (void *cbc, uint16_t port) |
603 | { | 603 | { |
604 | CURL *c; | 604 | CURL *c; |
605 | char url[512]; | 605 | char url[512]; |
@@ -610,7 +610,8 @@ setupCURL (void *cbc, int port) | |||
610 | /* A workaround for some old libcurl versions, which ignore the specified | 610 | /* A workaround for some old libcurl versions, which ignore the specified |
611 | * port by CURLOPT_PORT when authorisation is used. */ | 611 | * port by CURLOPT_PORT when authorisation is used. */ |
612 | res = snprintf (url, (sizeof(url) / sizeof(url[0])), | 612 | res = snprintf (url, (sizeof(url) / sizeof(url[0])), |
613 | "http://127.0.0.1:%d%s", port, MHD_URI_BASE_PATH); | 613 | "http://127.0.0.1:%u%s", |
614 | (unsigned int) port, MHD_URI_BASE_PATH); | ||
614 | if ((0 >= res) || ((sizeof(url) / sizeof(url[0])) <= (size_t) res)) | 615 | if ((0 >= res) || ((sizeof(url) / sizeof(url[0])) <= (size_t) res)) |
615 | externalErrorExitDesc ("Cannot form request URL"); | 616 | externalErrorExitDesc ("Cannot form request URL"); |
616 | } | 617 | } |
diff --git a/src/testcurl/test_digestauth_sha256.c b/src/testcurl/test_digestauth_sha256.c index cf6ab8ff..82b79c1b 100644 --- a/src/testcurl/test_digestauth_sha256.c +++ b/src/testcurl/test_digestauth_sha256.c | |||
@@ -194,9 +194,9 @@ testDigestAuth (void) | |||
194 | } | 194 | } |
195 | while (off < 8) | 195 | while (off < 8) |
196 | { | 196 | { |
197 | len = read (fd, | 197 | len = (size_t) read (fd, |
198 | rnd + off, | 198 | rnd + off, |
199 | 8 - off); | 199 | 8 - off); |
200 | if (len == (size_t) -1) | 200 | if (len == (size_t) -1) |
201 | { | 201 | { |
202 | fprintf (stderr, | 202 | fprintf (stderr, |
@@ -262,8 +262,8 @@ testDigestAuth (void) | |||
262 | } | 262 | } |
263 | snprintf (url, | 263 | snprintf (url, |
264 | sizeof (url), | 264 | sizeof (url), |
265 | "http://127.0.0.1:%d/bar%%20foo?key=value", | 265 | "http://127.0.0.1:%u/bar%%20foo?key=value", |
266 | (int) port); | 266 | (unsigned int) port); |
267 | c = curl_easy_init (); | 267 | c = curl_easy_init (); |
268 | curl_easy_setopt (c, CURLOPT_URL, url); | 268 | curl_easy_setopt (c, CURLOPT_URL, url); |
269 | curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, ©Buffer); | 269 | curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, ©Buffer); |
diff --git a/src/testcurl/test_digestauth_with_arguments.c b/src/testcurl/test_digestauth_with_arguments.c index 903d90a2..f0c6cd4b 100644 --- a/src/testcurl/test_digestauth_with_arguments.c +++ b/src/testcurl/test_digestauth_with_arguments.c | |||
@@ -184,7 +184,7 @@ testDigestAuth (void) | |||
184 | } | 184 | } |
185 | while (off < 8) | 185 | while (off < 8) |
186 | { | 186 | { |
187 | len = read (fd, rnd + off, 8 - off); | 187 | len = (size_t) read (fd, rnd + off, 8 - off); |
188 | if (len == (size_t) -1) | 188 | if (len == (size_t) -1) |
189 | { | 189 | { |
190 | fprintf (stderr, | 190 | fprintf (stderr, |
@@ -239,9 +239,9 @@ testDigestAuth (void) | |||
239 | } | 239 | } |
240 | snprintf (url, | 240 | snprintf (url, |
241 | sizeof (url), | 241 | sizeof (url), |
242 | "http://127.0.0.1:%d/bar%%20foo?" | 242 | "http://127.0.0.1:%u/bar%%20foo?" |
243 | "key=value&more=even%%20more&empty&=no_key&&same=one&&same=two", | 243 | "key=value&more=even%%20more&empty&=no_key&&same=one&&same=two", |
244 | (int) port); | 244 | (unsigned int) port); |
245 | c = curl_easy_init (); | 245 | c = curl_easy_init (); |
246 | curl_easy_setopt (c, CURLOPT_URL, url); | 246 | curl_easy_setopt (c, CURLOPT_URL, url); |
247 | curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, ©Buffer); | 247 | curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, ©Buffer); |
diff --git a/src/testcurl/test_get.c b/src/testcurl/test_get.c index c412d257..732bd3b1 100644 --- a/src/testcurl/test_get.c +++ b/src/testcurl/test_get.c | |||
@@ -58,7 +58,7 @@ | |||
58 | #endif | 58 | #endif |
59 | 59 | ||
60 | static int oneone; | 60 | static int oneone; |
61 | static int global_port; | 61 | static uint16_t global_port; |
62 | 62 | ||
63 | struct CBC | 63 | struct CBC |
64 | { | 64 | { |
@@ -171,8 +171,8 @@ ahc_echo (void *cls, | |||
171 | } | 171 | } |
172 | 172 | ||
173 | 173 | ||
174 | static int | 174 | static unsigned int |
175 | testInternalGet (int poll_flag) | 175 | testInternalGet (uint32_t poll_flag) |
176 | { | 176 | { |
177 | struct MHD_Daemon *d; | 177 | struct MHD_Daemon *d; |
178 | CURL *c; | 178 | CURL *c; |
@@ -192,7 +192,7 @@ testInternalGet (int poll_flag) | |||
192 | cbc.size = 2048; | 192 | cbc.size = 2048; |
193 | cbc.pos = 0; | 193 | cbc.pos = 0; |
194 | d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | 194 | d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG |
195 | | poll_flag, | 195 | | (enum MHD_FLAG) poll_flag, |
196 | global_port, NULL, NULL, | 196 | global_port, NULL, NULL, |
197 | &ahc_echo, NULL, | 197 | &ahc_echo, NULL, |
198 | MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, | 198 | MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, |
@@ -207,7 +207,7 @@ testInternalGet (int poll_flag) | |||
207 | { | 207 | { |
208 | MHD_stop_daemon (d); return 32; | 208 | MHD_stop_daemon (d); return 32; |
209 | } | 209 | } |
210 | global_port = (int) dinfo->port; | 210 | global_port = dinfo->port; |
211 | } | 211 | } |
212 | c = curl_easy_init (); | 212 | c = curl_easy_init (); |
213 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1" EXPECTED_URI_PATH); | 213 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1" EXPECTED_URI_PATH); |
@@ -244,8 +244,8 @@ testInternalGet (int poll_flag) | |||
244 | } | 244 | } |
245 | 245 | ||
246 | 246 | ||
247 | static int | 247 | static unsigned int |
248 | testMultithreadedGet (int poll_flag) | 248 | testMultithreadedGet (uint32_t poll_flag) |
249 | { | 249 | { |
250 | struct MHD_Daemon *d; | 250 | struct MHD_Daemon *d; |
251 | CURL *c; | 251 | CURL *c; |
@@ -266,7 +266,7 @@ testMultithreadedGet (int poll_flag) | |||
266 | cbc.pos = 0; | 266 | cbc.pos = 0; |
267 | d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 267 | d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION |
268 | | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | 268 | | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG |
269 | | poll_flag, | 269 | | (enum MHD_FLAG) poll_flag, |
270 | global_port, NULL, NULL, | 270 | global_port, NULL, NULL, |
271 | &ahc_echo, NULL, | 271 | &ahc_echo, NULL, |
272 | MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, | 272 | MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, |
@@ -281,7 +281,7 @@ testMultithreadedGet (int poll_flag) | |||
281 | { | 281 | { |
282 | MHD_stop_daemon (d); return 32; | 282 | MHD_stop_daemon (d); return 32; |
283 | } | 283 | } |
284 | global_port = (int) dinfo->port; | 284 | global_port = dinfo->port; |
285 | } | 285 | } |
286 | c = curl_easy_init (); | 286 | c = curl_easy_init (); |
287 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1" EXPECTED_URI_PATH); | 287 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1" EXPECTED_URI_PATH); |
@@ -318,8 +318,8 @@ testMultithreadedGet (int poll_flag) | |||
318 | } | 318 | } |
319 | 319 | ||
320 | 320 | ||
321 | static int | 321 | static unsigned int |
322 | testMultithreadedPoolGet (int poll_flag) | 322 | testMultithreadedPoolGet (uint32_t poll_flag) |
323 | { | 323 | { |
324 | struct MHD_Daemon *d; | 324 | struct MHD_Daemon *d; |
325 | CURL *c; | 325 | CURL *c; |
@@ -339,7 +339,7 @@ testMultithreadedPoolGet (int poll_flag) | |||
339 | cbc.size = 2048; | 339 | cbc.size = 2048; |
340 | cbc.pos = 0; | 340 | cbc.pos = 0; |
341 | d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | 341 | d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG |
342 | | poll_flag, | 342 | | (enum MHD_FLAG) poll_flag, |
343 | global_port, NULL, NULL, | 343 | global_port, NULL, NULL, |
344 | &ahc_echo, NULL, | 344 | &ahc_echo, NULL, |
345 | MHD_OPTION_THREAD_POOL_SIZE, MHD_CPU_COUNT, | 345 | MHD_OPTION_THREAD_POOL_SIZE, MHD_CPU_COUNT, |
@@ -355,7 +355,7 @@ testMultithreadedPoolGet (int poll_flag) | |||
355 | { | 355 | { |
356 | MHD_stop_daemon (d); return 32; | 356 | MHD_stop_daemon (d); return 32; |
357 | } | 357 | } |
358 | global_port = (int) dinfo->port; | 358 | global_port = dinfo->port; |
359 | } | 359 | } |
360 | c = curl_easy_init (); | 360 | c = curl_easy_init (); |
361 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1" EXPECTED_URI_PATH); | 361 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1" EXPECTED_URI_PATH); |
@@ -392,7 +392,7 @@ testMultithreadedPoolGet (int poll_flag) | |||
392 | } | 392 | } |
393 | 393 | ||
394 | 394 | ||
395 | static int | 395 | static unsigned int |
396 | testExternalGet (void) | 396 | testExternalGet (void) |
397 | { | 397 | { |
398 | struct MHD_Daemon *d; | 398 | struct MHD_Daemon *d; |
@@ -438,7 +438,7 @@ testExternalGet (void) | |||
438 | { | 438 | { |
439 | MHD_stop_daemon (d); return 32; | 439 | MHD_stop_daemon (d); return 32; |
440 | } | 440 | } |
441 | global_port = (int) dinfo->port; | 441 | global_port = dinfo->port; |
442 | } | 442 | } |
443 | c = curl_easy_init (); | 443 | c = curl_easy_init (); |
444 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1" EXPECTED_URI_PATH); | 444 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1" EXPECTED_URI_PATH); |
@@ -577,8 +577,8 @@ testExternalGet (void) | |||
577 | } | 577 | } |
578 | 578 | ||
579 | 579 | ||
580 | static int | 580 | static unsigned int |
581 | testUnknownPortGet (int poll_flag) | 581 | testUnknownPortGet (uint32_t poll_flag) |
582 | { | 582 | { |
583 | struct MHD_Daemon *d; | 583 | struct MHD_Daemon *d; |
584 | const union MHD_DaemonInfo *di; | 584 | const union MHD_DaemonInfo *di; |
@@ -586,7 +586,7 @@ testUnknownPortGet (int poll_flag) | |||
586 | char buf[2048]; | 586 | char buf[2048]; |
587 | struct CBC cbc; | 587 | struct CBC cbc; |
588 | CURLcode errornum; | 588 | CURLcode errornum; |
589 | int port; | 589 | uint16_t port; |
590 | 590 | ||
591 | struct sockaddr_in addr; | 591 | struct sockaddr_in addr; |
592 | socklen_t addr_len = sizeof(addr); | 592 | socklen_t addr_len = sizeof(addr); |
@@ -599,7 +599,7 @@ testUnknownPortGet (int poll_flag) | |||
599 | cbc.size = 2048; | 599 | cbc.size = 2048; |
600 | cbc.pos = 0; | 600 | cbc.pos = 0; |
601 | d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | 601 | d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG |
602 | | poll_flag, | 602 | | (enum MHD_FLAG) poll_flag, |
603 | 0, NULL, NULL, &ahc_echo, NULL, | 603 | 0, NULL, NULL, &ahc_echo, NULL, |
604 | MHD_OPTION_SOCK_ADDR, &addr, | 604 | MHD_OPTION_SOCK_ADDR, &addr, |
605 | MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, | 605 | MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, |
@@ -615,7 +615,7 @@ testUnknownPortGet (int poll_flag) | |||
615 | 615 | ||
616 | if (addr.sin_family != AF_INET) | 616 | if (addr.sin_family != AF_INET) |
617 | return 26214; | 617 | return 26214; |
618 | port = (int) ntohs (addr.sin_port); | 618 | port = ntohs (addr.sin_port); |
619 | } | 619 | } |
620 | else | 620 | else |
621 | { | 621 | { |
@@ -625,13 +625,13 @@ testUnknownPortGet (int poll_flag) | |||
625 | { | 625 | { |
626 | MHD_stop_daemon (d); return 32; | 626 | MHD_stop_daemon (d); return 32; |
627 | } | 627 | } |
628 | port = (int) dinfo->port; | 628 | port = dinfo->port; |
629 | } | 629 | } |
630 | 630 | ||
631 | snprintf (buf, | 631 | snprintf (buf, |
632 | sizeof(buf), | 632 | sizeof(buf), |
633 | "http://127.0.0.1:%d%s", | 633 | "http://127.0.0.1:%u%s", |
634 | port, | 634 | (unsigned int) port, |
635 | EXPECTED_URI_PATH); | 635 | EXPECTED_URI_PATH); |
636 | 636 | ||
637 | c = curl_easy_init (); | 637 | c = curl_easy_init (); |
@@ -668,8 +668,8 @@ testUnknownPortGet (int poll_flag) | |||
668 | } | 668 | } |
669 | 669 | ||
670 | 670 | ||
671 | static int | 671 | static unsigned int |
672 | testStopRace (int poll_flag) | 672 | testStopRace (uint32_t poll_flag) |
673 | { | 673 | { |
674 | struct sockaddr_in sin; | 674 | struct sockaddr_in sin; |
675 | MHD_socket fd; | 675 | MHD_socket fd; |
@@ -685,7 +685,7 @@ testStopRace (int poll_flag) | |||
685 | 685 | ||
686 | d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 686 | d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION |
687 | | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | 687 | | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG |
688 | | poll_flag, | 688 | | (enum MHD_FLAG) poll_flag, |
689 | global_port, NULL, NULL, | 689 | global_port, NULL, NULL, |
690 | &ahc_echo, NULL, | 690 | &ahc_echo, NULL, |
691 | MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, | 691 | MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, |
@@ -700,7 +700,7 @@ testStopRace (int poll_flag) | |||
700 | { | 700 | { |
701 | MHD_stop_daemon (d); return 32; | 701 | MHD_stop_daemon (d); return 32; |
702 | } | 702 | } |
703 | global_port = (int) dinfo->port; | 703 | global_port = dinfo->port; |
704 | } | 704 | } |
705 | 705 | ||
706 | fd = socket (PF_INET, SOCK_STREAM, 0); | 706 | fd = socket (PF_INET, SOCK_STREAM, 0); |
@@ -797,8 +797,8 @@ curlExcessFound (CURL *c, | |||
797 | } | 797 | } |
798 | 798 | ||
799 | 799 | ||
800 | static int | 800 | static unsigned int |
801 | testEmptyGet (int poll_flag) | 801 | testEmptyGet (uint32_t poll_flag) |
802 | { | 802 | { |
803 | struct MHD_Daemon *d; | 803 | struct MHD_Daemon *d; |
804 | CURL *c; | 804 | CURL *c; |
@@ -819,7 +819,7 @@ testEmptyGet (int poll_flag) | |||
819 | cbc.size = 2048; | 819 | cbc.size = 2048; |
820 | cbc.pos = 0; | 820 | cbc.pos = 0; |
821 | d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | 821 | d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG |
822 | | poll_flag, | 822 | | (enum MHD_FLAG) poll_flag, |
823 | global_port, NULL, NULL, | 823 | global_port, NULL, NULL, |
824 | &ahc_empty, NULL, | 824 | &ahc_empty, NULL, |
825 | MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, | 825 | MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, |
@@ -834,7 +834,7 @@ testEmptyGet (int poll_flag) | |||
834 | { | 834 | { |
835 | MHD_stop_daemon (d); return 32; | 835 | MHD_stop_daemon (d); return 32; |
836 | } | 836 | } |
837 | global_port = (int) dinfo->port; | 837 | global_port = dinfo->port; |
838 | } | 838 | } |
839 | c = curl_easy_init (); | 839 | c = curl_easy_init (); |
840 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1" EXPECTED_URI_PATH); | 840 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1" EXPECTED_URI_PATH); |
diff --git a/src/testcurl/test_get_chunked.c b/src/testcurl/test_get_chunked.c index 3643a2ba..5c7b6f39 100644 --- a/src/testcurl/test_get_chunked.c +++ b/src/testcurl/test_get_chunked.c | |||
@@ -84,7 +84,7 @@ int chunked_forced; | |||
84 | /** | 84 | /** |
85 | * MHD port used for testing | 85 | * MHD port used for testing |
86 | */ | 86 | */ |
87 | int port_global; | 87 | uint16_t port_global; |
88 | 88 | ||
89 | 89 | ||
90 | struct headers_check_result | 90 | struct headers_check_result |
@@ -159,7 +159,9 @@ crc (void *cls, | |||
159 | 159 | ||
160 | if (max < RESP_BLOCK_SIZE) | 160 | if (max < RESP_BLOCK_SIZE) |
161 | abort (); /* should not happen in this testcase... */ | 161 | abort (); /* should not happen in this testcase... */ |
162 | memset (buf, 'A' + (pos / RESP_BLOCK_SIZE), RESP_BLOCK_SIZE); | 162 | memset (buf, |
163 | 'A' + (char) (unsigned char) (pos / RESP_BLOCK_SIZE), | ||
164 | RESP_BLOCK_SIZE); | ||
163 | return RESP_BLOCK_SIZE; | 165 | return RESP_BLOCK_SIZE; |
164 | } | 166 | } |
165 | 167 | ||
@@ -225,7 +227,9 @@ ahc_echo (void *cls, | |||
225 | if (NULL == buf) | 227 | if (NULL == buf) |
226 | _exit (99); | 228 | _exit (99); |
227 | for (pos = 0; pos < resp_size; pos += RESP_BLOCK_SIZE) | 229 | for (pos = 0; pos < resp_size; pos += RESP_BLOCK_SIZE) |
228 | memset (buf + pos, 'A' + (pos / RESP_BLOCK_SIZE), RESP_BLOCK_SIZE); | 230 | memset (buf + pos, |
231 | 'A' + (char) (unsigned char) (pos / RESP_BLOCK_SIZE), | ||
232 | RESP_BLOCK_SIZE); | ||
229 | 233 | ||
230 | response = MHD_create_response_from_buffer_copy (resp_size, buf); | 234 | response = MHD_create_response_from_buffer_copy (resp_size, buf); |
231 | free (buf); | 235 | free (buf); |
@@ -264,8 +268,8 @@ ahc_echo (void *cls, | |||
264 | } | 268 | } |
265 | 269 | ||
266 | 270 | ||
267 | static int | 271 | static unsigned int |
268 | validate (struct CBC cbc, int ebase) | 272 | validate (struct CBC cbc, unsigned int ebase) |
269 | { | 273 | { |
270 | int i; | 274 | int i; |
271 | char buf[RESP_BLOCK_SIZE]; | 275 | char buf[RESP_BLOCK_SIZE]; |
@@ -306,7 +310,7 @@ validate (struct CBC cbc, int ebase) | |||
306 | } | 310 | } |
307 | 311 | ||
308 | 312 | ||
309 | static int | 313 | static unsigned int |
310 | testInternalGet (void) | 314 | testInternalGet (void) |
311 | { | 315 | { |
312 | struct MHD_Daemon *d; | 316 | struct MHD_Daemon *d; |
@@ -314,7 +318,7 @@ testInternalGet (void) | |||
314 | char buf[2048]; | 318 | char buf[2048]; |
315 | struct CBC cbc; | 319 | struct CBC cbc; |
316 | CURLcode errornum; | 320 | CURLcode errornum; |
317 | int port; | 321 | uint16_t port; |
318 | struct curl_slist *h_list = NULL; | 322 | struct curl_slist *h_list = NULL; |
319 | struct headers_check_result hdr_check; | 323 | struct headers_check_result hdr_check; |
320 | 324 | ||
@@ -334,7 +338,7 @@ testInternalGet (void) | |||
334 | { | 338 | { |
335 | MHD_stop_daemon (d); return 32; | 339 | MHD_stop_daemon (d); return 32; |
336 | } | 340 | } |
337 | port = (int) dinfo->port; | 341 | port = dinfo->port; |
338 | if (0 == port_global) | 342 | if (0 == port_global) |
339 | port_global = port; /* Re-use the same port for all checks */ | 343 | port_global = port; /* Re-use the same port for all checks */ |
340 | } | 344 | } |
@@ -388,7 +392,7 @@ testInternalGet (void) | |||
388 | } | 392 | } |
389 | 393 | ||
390 | 394 | ||
391 | static int | 395 | static unsigned int |
392 | testMultithreadedGet (void) | 396 | testMultithreadedGet (void) |
393 | { | 397 | { |
394 | struct MHD_Daemon *d; | 398 | struct MHD_Daemon *d; |
@@ -396,7 +400,7 @@ testMultithreadedGet (void) | |||
396 | char buf[2048]; | 400 | char buf[2048]; |
397 | struct CBC cbc; | 401 | struct CBC cbc; |
398 | CURLcode errornum; | 402 | CURLcode errornum; |
399 | int port; | 403 | uint16_t port; |
400 | struct curl_slist *h_list = NULL; | 404 | struct curl_slist *h_list = NULL; |
401 | struct headers_check_result hdr_check; | 405 | struct headers_check_result hdr_check; |
402 | 406 | ||
@@ -417,7 +421,7 @@ testMultithreadedGet (void) | |||
417 | { | 421 | { |
418 | MHD_stop_daemon (d); return 32; | 422 | MHD_stop_daemon (d); return 32; |
419 | } | 423 | } |
420 | port = (int) dinfo->port; | 424 | port = dinfo->port; |
421 | if (0 == port_global) | 425 | if (0 == port_global) |
422 | port_global = port; /* Re-use the same port for all checks */ | 426 | port_global = port; /* Re-use the same port for all checks */ |
423 | } | 427 | } |
@@ -471,7 +475,7 @@ testMultithreadedGet (void) | |||
471 | } | 475 | } |
472 | 476 | ||
473 | 477 | ||
474 | static int | 478 | static unsigned int |
475 | testMultithreadedPoolGet (void) | 479 | testMultithreadedPoolGet (void) |
476 | { | 480 | { |
477 | struct MHD_Daemon *d; | 481 | struct MHD_Daemon *d; |
@@ -479,7 +483,7 @@ testMultithreadedPoolGet (void) | |||
479 | char buf[2048]; | 483 | char buf[2048]; |
480 | struct CBC cbc; | 484 | struct CBC cbc; |
481 | CURLcode errornum; | 485 | CURLcode errornum; |
482 | int port; | 486 | uint16_t port; |
483 | struct curl_slist *h_list = NULL; | 487 | struct curl_slist *h_list = NULL; |
484 | struct headers_check_result hdr_check; | 488 | struct headers_check_result hdr_check; |
485 | 489 | ||
@@ -501,7 +505,7 @@ testMultithreadedPoolGet (void) | |||
501 | { | 505 | { |
502 | MHD_stop_daemon (d); return 32; | 506 | MHD_stop_daemon (d); return 32; |
503 | } | 507 | } |
504 | port = (int) dinfo->port; | 508 | port = dinfo->port; |
505 | if (0 == port_global) | 509 | if (0 == port_global) |
506 | port_global = port; /* Re-use the same port for all checks */ | 510 | port_global = port; /* Re-use the same port for all checks */ |
507 | } | 511 | } |
@@ -555,7 +559,7 @@ testMultithreadedPoolGet (void) | |||
555 | } | 559 | } |
556 | 560 | ||
557 | 561 | ||
558 | static int | 562 | static unsigned int |
559 | testExternalGet (void) | 563 | testExternalGet (void) |
560 | { | 564 | { |
561 | struct MHD_Daemon *d; | 565 | struct MHD_Daemon *d; |
@@ -577,7 +581,7 @@ testExternalGet (void) | |||
577 | struct CURLMsg *msg; | 581 | struct CURLMsg *msg; |
578 | time_t start; | 582 | time_t start; |
579 | struct timeval tv; | 583 | struct timeval tv; |
580 | int port; | 584 | uint16_t port; |
581 | struct curl_slist *h_list = NULL; | 585 | struct curl_slist *h_list = NULL; |
582 | struct headers_check_result hdr_check; | 586 | struct headers_check_result hdr_check; |
583 | 587 | ||
@@ -598,7 +602,7 @@ testExternalGet (void) | |||
598 | { | 602 | { |
599 | MHD_stop_daemon (d); return 32; | 603 | MHD_stop_daemon (d); return 32; |
600 | } | 604 | } |
601 | port = (int) dinfo->port; | 605 | port = dinfo->port; |
602 | if (0 == port_global) | 606 | if (0 == port_global) |
603 | port_global = port; /* Re-use the same port for all checks */ | 607 | port_global = port; /* Re-use the same port for all checks */ |
604 | } | 608 | } |
diff --git a/src/testcurl/test_get_close_keep_alive.c b/src/testcurl/test_get_close_keep_alive.c index 169a2098..3754325c 100644 --- a/src/testcurl/test_get_close_keep_alive.c +++ b/src/testcurl/test_get_close_keep_alive.c | |||
@@ -167,9 +167,9 @@ _libcurlErrorExit_func (const char *errDesc, const char *funcName, int lineNum) | |||
167 | HDR_CONN_KEEP_ALIVE_VALUE | 167 | HDR_CONN_KEEP_ALIVE_VALUE |
168 | 168 | ||
169 | /* Global parameters */ | 169 | /* Global parameters */ |
170 | static int oneone; /**< Use HTTP/1.1 instead of HTTP/1.0 for requests*/ | 170 | static int oneone; /**< Use HTTP/1.1 instead of HTTP/1.0 for requests*/ |
171 | static int conn_close; /**< Don't use Keep-Alive */ | 171 | static int conn_close; /**< Don't use Keep-Alive */ |
172 | static int global_port; /**< MHD daemons listen port number */ | 172 | static uint16_t global_port; /**< MHD daemons listen port number */ |
173 | static int slow_reply = 0; /**< Slowdown MHD replies */ | 173 | static int slow_reply = 0; /**< Slowdown MHD replies */ |
174 | static int ignore_response_errors = 0; /**< Do not fail test if CURL | 174 | static int ignore_response_errors = 0; /**< Do not fail test if CURL |
175 | returns error */ | 175 | returns error */ |
@@ -384,15 +384,15 @@ struct curlQueryParams | |||
384 | const char *queryPath; | 384 | const char *queryPath; |
385 | 385 | ||
386 | /* Destination port for CURL query */ | 386 | /* Destination port for CURL query */ |
387 | int queryPort; | 387 | uint16_t queryPort; |
388 | 388 | ||
389 | /* CURL query result error flag */ | 389 | /* CURL query result error flag */ |
390 | volatile int queryError; | 390 | volatile unsigned int queryError; |
391 | }; | 391 | }; |
392 | 392 | ||
393 | 393 | ||
394 | static CURL * | 394 | static CURL * |
395 | curlEasyInitForTest (const char *queryPath, int port, struct CBC *pcbc, | 395 | curlEasyInitForTest (const char *queryPath, uint16_t port, struct CBC *pcbc, |
396 | struct headers_check_result *hdr_chk_result, | 396 | struct headers_check_result *hdr_chk_result, |
397 | int add_hdr_close, int add_hdr_k_alive) | 397 | int add_hdr_close, int add_hdr_k_alive) |
398 | { | 398 | { |
@@ -625,7 +625,7 @@ getMhdActiveConnections (struct MHD_Daemon *d) | |||
625 | } | 625 | } |
626 | 626 | ||
627 | 627 | ||
628 | static int | 628 | static unsigned int |
629 | doCurlQueryInThread (struct MHD_Daemon *d, | 629 | doCurlQueryInThread (struct MHD_Daemon *d, |
630 | struct curlQueryParams *p, | 630 | struct curlQueryParams *p, |
631 | int add_hdr_close, | 631 | int add_hdr_close, |
@@ -853,11 +853,11 @@ doCurlQueryInThread (struct MHD_Daemon *d, | |||
853 | 853 | ||
854 | 854 | ||
855 | /* Perform test queries and shut down MHD daemon */ | 855 | /* Perform test queries and shut down MHD daemon */ |
856 | static int | 856 | static unsigned int |
857 | performTestQueries (struct MHD_Daemon *d, int d_port) | 857 | performTestQueries (struct MHD_Daemon *d, uint16_t d_port) |
858 | { | 858 | { |
859 | struct curlQueryParams qParam; | 859 | struct curlQueryParams qParam; |
860 | int ret = 0; /* Return value */ | 860 | unsigned int ret = 0; /* Return value */ |
861 | int i = 0; | 861 | int i = 0; |
862 | /* masks */ | 862 | /* masks */ |
863 | const int m_mhd_close = 1 << (i++); | 863 | const int m_mhd_close = 1 << (i++); |
@@ -932,7 +932,7 @@ enum testMhdPollType | |||
932 | static unsigned int | 932 | static unsigned int |
933 | testNumThreadsForPool (enum testMhdPollType pollType) | 933 | testNumThreadsForPool (enum testMhdPollType pollType) |
934 | { | 934 | { |
935 | int numThreads = MHD_CPU_COUNT; | 935 | unsigned int numThreads = MHD_CPU_COUNT; |
936 | (void) pollType; /* Don't care about pollType for this test */ | 936 | (void) pollType; /* Don't care about pollType for this test */ |
937 | return numThreads; /* No practical limit for non-cleanup test */ | 937 | return numThreads; /* No practical limit for non-cleanup test */ |
938 | } | 938 | } |
@@ -940,7 +940,7 @@ testNumThreadsForPool (enum testMhdPollType pollType) | |||
940 | 940 | ||
941 | static struct MHD_Daemon * | 941 | static struct MHD_Daemon * |
942 | startTestMhdDaemon (enum testMhdThreadsType thrType, | 942 | startTestMhdDaemon (enum testMhdThreadsType thrType, |
943 | enum testMhdPollType pollType, int *pport) | 943 | enum testMhdPollType pollType, uint16_t *pport) |
944 | { | 944 | { |
945 | struct MHD_Daemon *d; | 945 | struct MHD_Daemon *d; |
946 | const union MHD_DaemonInfo *dinfo; | 946 | const union MHD_DaemonInfo *dinfo; |
@@ -956,14 +956,15 @@ startTestMhdDaemon (enum testMhdThreadsType thrType, | |||
956 | } | 956 | } |
957 | 957 | ||
958 | if (testMhdThreadInternalPool != thrType) | 958 | if (testMhdThreadInternalPool != thrType) |
959 | d = MHD_start_daemon (((int) thrType) | ((int) pollType) | 959 | d = MHD_start_daemon (((unsigned int) thrType) | ((unsigned int) pollType) |
960 | | MHD_USE_ERROR_LOG, | 960 | | MHD_USE_ERROR_LOG, |
961 | *pport, NULL, NULL, | 961 | *pport, NULL, NULL, |
962 | &ahc_echo, NULL, | 962 | &ahc_echo, NULL, |
963 | MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, | 963 | MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, |
964 | MHD_OPTION_END); | 964 | MHD_OPTION_END); |
965 | else | 965 | else |
966 | d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | ((int) pollType) | 966 | d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD |
967 | | ((unsigned int) pollType) | ||
967 | | MHD_USE_ERROR_LOG, | 968 | | MHD_USE_ERROR_LOG, |
968 | *pport, NULL, NULL, | 969 | *pport, NULL, NULL, |
969 | &ahc_echo, NULL, | 970 | &ahc_echo, NULL, |
@@ -986,7 +987,7 @@ startTestMhdDaemon (enum testMhdThreadsType thrType, | |||
986 | fprintf (stderr, "MHD_get_daemon_info() failed.\n"); | 987 | fprintf (stderr, "MHD_get_daemon_info() failed.\n"); |
987 | abort (); | 988 | abort (); |
988 | } | 989 | } |
989 | *pport = (int) dinfo->port; | 990 | *pport = dinfo->port; |
990 | if (0 == global_port) | 991 | if (0 == global_port) |
991 | global_port = *pport; /* Reuse the same port for all tests */ | 992 | global_port = *pport; /* Reuse the same port for all tests */ |
992 | } | 993 | } |
@@ -998,11 +999,11 @@ startTestMhdDaemon (enum testMhdThreadsType thrType, | |||
998 | /* Test runners */ | 999 | /* Test runners */ |
999 | 1000 | ||
1000 | 1001 | ||
1001 | static int | 1002 | static unsigned int |
1002 | testExternalGet (void) | 1003 | testExternalGet (void) |
1003 | { | 1004 | { |
1004 | struct MHD_Daemon *d; | 1005 | struct MHD_Daemon *d; |
1005 | int d_port = global_port; /* Daemon's port */ | 1006 | uint16_t d_port = global_port; /* Daemon's port */ |
1006 | 1007 | ||
1007 | d = startTestMhdDaemon (testMhdThreadExternal, testMhdPollBySelect, &d_port); | 1008 | d = startTestMhdDaemon (testMhdThreadExternal, testMhdPollBySelect, &d_port); |
1008 | 1009 | ||
@@ -1010,11 +1011,11 @@ testExternalGet (void) | |||
1010 | } | 1011 | } |
1011 | 1012 | ||
1012 | 1013 | ||
1013 | static int | 1014 | static unsigned int |
1014 | testInternalGet (enum testMhdPollType pollType) | 1015 | testInternalGet (enum testMhdPollType pollType) |
1015 | { | 1016 | { |
1016 | struct MHD_Daemon *d; | 1017 | struct MHD_Daemon *d; |
1017 | int d_port = global_port; /* Daemon's port */ | 1018 | uint16_t d_port = global_port; /* Daemon's port */ |
1018 | 1019 | ||
1019 | d = startTestMhdDaemon (testMhdThreadInternal, pollType, | 1020 | d = startTestMhdDaemon (testMhdThreadInternal, pollType, |
1020 | &d_port); | 1021 | &d_port); |
@@ -1023,11 +1024,11 @@ testInternalGet (enum testMhdPollType pollType) | |||
1023 | } | 1024 | } |
1024 | 1025 | ||
1025 | 1026 | ||
1026 | static int | 1027 | static unsigned int |
1027 | testMultithreadedGet (enum testMhdPollType pollType) | 1028 | testMultithreadedGet (enum testMhdPollType pollType) |
1028 | { | 1029 | { |
1029 | struct MHD_Daemon *d; | 1030 | struct MHD_Daemon *d; |
1030 | int d_port = global_port; /* Daemon's port */ | 1031 | uint16_t d_port = global_port; /* Daemon's port */ |
1031 | 1032 | ||
1032 | d = startTestMhdDaemon (testMhdThreadInternalPerConnection, pollType, | 1033 | d = startTestMhdDaemon (testMhdThreadInternalPerConnection, pollType, |
1033 | &d_port); | 1034 | &d_port); |
@@ -1035,11 +1036,11 @@ testMultithreadedGet (enum testMhdPollType pollType) | |||
1035 | } | 1036 | } |
1036 | 1037 | ||
1037 | 1038 | ||
1038 | static int | 1039 | static unsigned int |
1039 | testMultithreadedPoolGet (enum testMhdPollType pollType) | 1040 | testMultithreadedPoolGet (enum testMhdPollType pollType) |
1040 | { | 1041 | { |
1041 | struct MHD_Daemon *d; | 1042 | struct MHD_Daemon *d; |
1042 | int d_port = global_port; /* Daemon's port */ | 1043 | uint16_t d_port = global_port; /* Daemon's port */ |
1043 | 1044 | ||
1044 | d = startTestMhdDaemon (testMhdThreadInternalPool, pollType, | 1045 | d = startTestMhdDaemon (testMhdThreadInternalPool, pollType, |
1045 | &d_port); | 1046 | &d_port); |
diff --git a/src/testcurl/test_get_empty.c b/src/testcurl/test_get_empty.c index 32d6b16f..1dd4500d 100644 --- a/src/testcurl/test_get_empty.c +++ b/src/testcurl/test_get_empty.c | |||
@@ -58,7 +58,7 @@ | |||
58 | #endif | 58 | #endif |
59 | 59 | ||
60 | static int oneone; | 60 | static int oneone; |
61 | static int global_port; | 61 | static uint16_t global_port; |
62 | 62 | ||
63 | struct CBC | 63 | struct CBC |
64 | { | 64 | { |
@@ -139,8 +139,8 @@ ahc_echo (void *cls, | |||
139 | } | 139 | } |
140 | 140 | ||
141 | 141 | ||
142 | static int | 142 | static unsigned int |
143 | testInternalGet (int poll_flag) | 143 | testInternalGet (uint32_t poll_flag) |
144 | { | 144 | { |
145 | struct MHD_Daemon *d; | 145 | struct MHD_Daemon *d; |
146 | CURL *c; | 146 | CURL *c; |
@@ -160,7 +160,7 @@ testInternalGet (int poll_flag) | |||
160 | cbc.size = 2048; | 160 | cbc.size = 2048; |
161 | cbc.pos = 0; | 161 | cbc.pos = 0; |
162 | d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | 162 | d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG |
163 | | poll_flag, | 163 | | (enum MHD_FLAG) poll_flag, |
164 | global_port, NULL, NULL, | 164 | global_port, NULL, NULL, |
165 | &ahc_echo, "GET", | 165 | &ahc_echo, "GET", |
166 | MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, | 166 | MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, |
@@ -175,7 +175,7 @@ testInternalGet (int poll_flag) | |||
175 | { | 175 | { |
176 | MHD_stop_daemon (d); return 32; | 176 | MHD_stop_daemon (d); return 32; |
177 | } | 177 | } |
178 | global_port = (int) dinfo->port; | 178 | global_port = dinfo->port; |
179 | } | 179 | } |
180 | c = curl_easy_init (); | 180 | c = curl_easy_init (); |
181 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1" EXPECTED_URI_PATH); | 181 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1" EXPECTED_URI_PATH); |
@@ -210,8 +210,8 @@ testInternalGet (int poll_flag) | |||
210 | } | 210 | } |
211 | 211 | ||
212 | 212 | ||
213 | static int | 213 | static unsigned int |
214 | testMultithreadedGet (int poll_flag) | 214 | testMultithreadedGet (uint32_t poll_flag) |
215 | { | 215 | { |
216 | struct MHD_Daemon *d; | 216 | struct MHD_Daemon *d; |
217 | CURL *c; | 217 | CURL *c; |
@@ -232,7 +232,7 @@ testMultithreadedGet (int poll_flag) | |||
232 | cbc.pos = 0; | 232 | cbc.pos = 0; |
233 | d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 233 | d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION |
234 | | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | 234 | | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG |
235 | | poll_flag, | 235 | | (enum MHD_FLAG) poll_flag, |
236 | global_port, NULL, NULL, | 236 | global_port, NULL, NULL, |
237 | &ahc_echo, "GET", | 237 | &ahc_echo, "GET", |
238 | MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, | 238 | MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, |
@@ -247,7 +247,7 @@ testMultithreadedGet (int poll_flag) | |||
247 | { | 247 | { |
248 | MHD_stop_daemon (d); return 32; | 248 | MHD_stop_daemon (d); return 32; |
249 | } | 249 | } |
250 | global_port = (int) dinfo->port; | 250 | global_port = dinfo->port; |
251 | } | 251 | } |
252 | c = curl_easy_init (); | 252 | c = curl_easy_init (); |
253 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1" EXPECTED_URI_PATH); | 253 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1" EXPECTED_URI_PATH); |
@@ -282,8 +282,8 @@ testMultithreadedGet (int poll_flag) | |||
282 | } | 282 | } |
283 | 283 | ||
284 | 284 | ||
285 | static int | 285 | static unsigned int |
286 | testMultithreadedPoolGet (int poll_flag) | 286 | testMultithreadedPoolGet (uint32_t poll_flag) |
287 | { | 287 | { |
288 | struct MHD_Daemon *d; | 288 | struct MHD_Daemon *d; |
289 | CURL *c; | 289 | CURL *c; |
@@ -303,7 +303,7 @@ testMultithreadedPoolGet (int poll_flag) | |||
303 | cbc.size = 2048; | 303 | cbc.size = 2048; |
304 | cbc.pos = 0; | 304 | cbc.pos = 0; |
305 | d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | 305 | d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG |
306 | | poll_flag, | 306 | | (enum MHD_FLAG) poll_flag, |
307 | global_port, NULL, NULL, | 307 | global_port, NULL, NULL, |
308 | &ahc_echo, "GET", | 308 | &ahc_echo, "GET", |
309 | MHD_OPTION_THREAD_POOL_SIZE, MHD_CPU_COUNT, | 309 | MHD_OPTION_THREAD_POOL_SIZE, MHD_CPU_COUNT, |
@@ -319,7 +319,7 @@ testMultithreadedPoolGet (int poll_flag) | |||
319 | { | 319 | { |
320 | MHD_stop_daemon (d); return 32; | 320 | MHD_stop_daemon (d); return 32; |
321 | } | 321 | } |
322 | global_port = (int) dinfo->port; | 322 | global_port = dinfo->port; |
323 | } | 323 | } |
324 | c = curl_easy_init (); | 324 | c = curl_easy_init (); |
325 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1" EXPECTED_URI_PATH); | 325 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1" EXPECTED_URI_PATH); |
@@ -354,7 +354,7 @@ testMultithreadedPoolGet (int poll_flag) | |||
354 | } | 354 | } |
355 | 355 | ||
356 | 356 | ||
357 | static int | 357 | static unsigned int |
358 | testExternalGet () | 358 | testExternalGet () |
359 | { | 359 | { |
360 | struct MHD_Daemon *d; | 360 | struct MHD_Daemon *d; |
@@ -400,7 +400,7 @@ testExternalGet () | |||
400 | { | 400 | { |
401 | MHD_stop_daemon (d); return 32; | 401 | MHD_stop_daemon (d); return 32; |
402 | } | 402 | } |
403 | global_port = (int) dinfo->port; | 403 | global_port = dinfo->port; |
404 | } | 404 | } |
405 | c = curl_easy_init (); | 405 | c = curl_easy_init (); |
406 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1" EXPECTED_URI_PATH); | 406 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1" EXPECTED_URI_PATH); |
@@ -537,8 +537,8 @@ testExternalGet () | |||
537 | } | 537 | } |
538 | 538 | ||
539 | 539 | ||
540 | static int | 540 | static unsigned int |
541 | testUnknownPortGet (int poll_flag) | 541 | testUnknownPortGet (uint32_t poll_flag) |
542 | { | 542 | { |
543 | struct MHD_Daemon *d; | 543 | struct MHD_Daemon *d; |
544 | const union MHD_DaemonInfo *di; | 544 | const union MHD_DaemonInfo *di; |
@@ -546,7 +546,7 @@ testUnknownPortGet (int poll_flag) | |||
546 | char buf[2048]; | 546 | char buf[2048]; |
547 | struct CBC cbc; | 547 | struct CBC cbc; |
548 | CURLcode errornum; | 548 | CURLcode errornum; |
549 | int port; | 549 | uint16_t port; |
550 | 550 | ||
551 | struct sockaddr_in addr; | 551 | struct sockaddr_in addr; |
552 | socklen_t addr_len = sizeof(addr); | 552 | socklen_t addr_len = sizeof(addr); |
@@ -559,7 +559,7 @@ testUnknownPortGet (int poll_flag) | |||
559 | cbc.size = 2048; | 559 | cbc.size = 2048; |
560 | cbc.pos = 0; | 560 | cbc.pos = 0; |
561 | d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | 561 | d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG |
562 | | poll_flag, | 562 | | (enum MHD_FLAG) poll_flag, |
563 | 0, NULL, NULL, &ahc_echo, "GET", | 563 | 0, NULL, NULL, &ahc_echo, "GET", |
564 | MHD_OPTION_SOCK_ADDR, &addr, | 564 | MHD_OPTION_SOCK_ADDR, &addr, |
565 | MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, | 565 | MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, |
@@ -575,7 +575,7 @@ testUnknownPortGet (int poll_flag) | |||
575 | 575 | ||
576 | if (addr.sin_family != AF_INET) | 576 | if (addr.sin_family != AF_INET) |
577 | return 26214; | 577 | return 26214; |
578 | port = (int) ntohs (addr.sin_port); | 578 | port = ntohs (addr.sin_port); |
579 | } | 579 | } |
580 | else | 580 | else |
581 | { | 581 | { |
@@ -585,13 +585,13 @@ testUnknownPortGet (int poll_flag) | |||
585 | { | 585 | { |
586 | MHD_stop_daemon (d); return 32; | 586 | MHD_stop_daemon (d); return 32; |
587 | } | 587 | } |
588 | port = (int) dinfo->port; | 588 | port = dinfo->port; |
589 | } | 589 | } |
590 | 590 | ||
591 | snprintf (buf, | 591 | snprintf (buf, |
592 | sizeof(buf), | 592 | sizeof(buf), |
593 | "http://127.0.0.1:%d%s", | 593 | "http://127.0.0.1:%u%s", |
594 | port, | 594 | (unsigned int) port, |
595 | EXPECTED_URI_PATH); | 595 | EXPECTED_URI_PATH); |
596 | 596 | ||
597 | c = curl_easy_init (); | 597 | c = curl_easy_init (); |
@@ -626,8 +626,8 @@ testUnknownPortGet (int poll_flag) | |||
626 | } | 626 | } |
627 | 627 | ||
628 | 628 | ||
629 | static int | 629 | static unsigned int |
630 | testStopRace (int poll_flag) | 630 | testStopRace (uint32_t poll_flag) |
631 | { | 631 | { |
632 | struct sockaddr_in sin; | 632 | struct sockaddr_in sin; |
633 | MHD_socket fd; | 633 | MHD_socket fd; |
@@ -643,7 +643,7 @@ testStopRace (int poll_flag) | |||
643 | 643 | ||
644 | d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 644 | d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION |
645 | | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | 645 | | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG |
646 | | poll_flag, | 646 | | (enum MHD_FLAG) poll_flag, |
647 | global_port, NULL, NULL, | 647 | global_port, NULL, NULL, |
648 | &ahc_echo, "GET", | 648 | &ahc_echo, "GET", |
649 | MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, | 649 | MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, |
@@ -658,7 +658,7 @@ testStopRace (int poll_flag) | |||
658 | { | 658 | { |
659 | MHD_stop_daemon (d); return 32; | 659 | MHD_stop_daemon (d); return 32; |
660 | } | 660 | } |
661 | global_port = (int) dinfo->port; | 661 | global_port = dinfo->port; |
662 | } | 662 | } |
663 | 663 | ||
664 | fd = socket (PF_INET, SOCK_STREAM, 0); | 664 | fd = socket (PF_INET, SOCK_STREAM, 0); |
@@ -749,8 +749,8 @@ curlExcessFound (CURL *c, curl_infotype type, char *data, size_t size, | |||
749 | } | 749 | } |
750 | 750 | ||
751 | 751 | ||
752 | static int | 752 | static unsigned int |
753 | testEmptyGet (int poll_flag) | 753 | testEmptyGet (uint32_t poll_flag) |
754 | { | 754 | { |
755 | struct MHD_Daemon *d; | 755 | struct MHD_Daemon *d; |
756 | CURL *c; | 756 | CURL *c; |
@@ -771,7 +771,7 @@ testEmptyGet (int poll_flag) | |||
771 | cbc.size = 2048; | 771 | cbc.size = 2048; |
772 | cbc.pos = 0; | 772 | cbc.pos = 0; |
773 | d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | 773 | d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG |
774 | | poll_flag, | 774 | | (enum MHD_FLAG) poll_flag, |
775 | global_port, NULL, NULL, | 775 | global_port, NULL, NULL, |
776 | &ahc_empty, NULL, | 776 | &ahc_empty, NULL, |
777 | MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, | 777 | MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, |
@@ -786,7 +786,7 @@ testEmptyGet (int poll_flag) | |||
786 | { | 786 | { |
787 | MHD_stop_daemon (d); return 32; | 787 | MHD_stop_daemon (d); return 32; |
788 | } | 788 | } |
789 | global_port = (int) dinfo->port; | 789 | global_port = dinfo->port; |
790 | } | 790 | } |
791 | c = curl_easy_init (); | 791 | c = curl_easy_init (); |
792 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1" EXPECTED_URI_PATH); | 792 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1" EXPECTED_URI_PATH); |
diff --git a/src/testcurl/test_get_iovec.c b/src/testcurl/test_get_iovec.c index 0a41e6d1..f979ae6e 100644 --- a/src/testcurl/test_get_iovec.c +++ b/src/testcurl/test_get_iovec.c | |||
@@ -169,8 +169,8 @@ ahc_cont (void *cls, | |||
169 | 169 | ||
170 | for (i = 0; i < TESTSTR_IOVCNT; ++i) | 170 | for (i = 0; i < TESTSTR_IOVCNT; ++i) |
171 | { | 171 | { |
172 | iov[i].iov_base = data + (i * (TESTSTR_SIZE / TESTSTR_IOVCNT | 172 | iov[i].iov_base = data + (((size_t) i) |
173 | / sizeof(int))); | 173 | * (TESTSTR_SIZE / TESTSTR_IOVCNT / sizeof(int))); |
174 | iov[i].iov_len = TESTSTR_SIZE / TESTSTR_IOVCNT; | 174 | iov[i].iov_len = TESTSTR_SIZE / TESTSTR_IOVCNT; |
175 | } | 175 | } |
176 | 176 | ||
@@ -230,7 +230,7 @@ ahc_ncont (void *cls, | |||
230 | 230 | ||
231 | for (i = 0; i < (int) (TESTSTR_IOVLEN / sizeof(int)); ++i) | 231 | for (i = 0; i < (int) (TESTSTR_IOVLEN / sizeof(int)); ++i) |
232 | { | 232 | { |
233 | data[i] = i + (j * TESTSTR_IOVLEN / sizeof(int)); | 233 | data[i] = i + (j * (int) (TESTSTR_IOVLEN / sizeof(int))); |
234 | } | 234 | } |
235 | iov[j].iov_base = (const void *) data; | 235 | iov[j].iov_base = (const void *) data; |
236 | iov[j].iov_len = TESTSTR_IOVLEN; | 236 | iov[j].iov_len = TESTSTR_IOVLEN; |
@@ -251,14 +251,14 @@ ahc_ncont (void *cls, | |||
251 | } | 251 | } |
252 | 252 | ||
253 | 253 | ||
254 | static int | 254 | static unsigned int |
255 | testInternalGet (bool contiguous) | 255 | testInternalGet (bool contiguous) |
256 | { | 256 | { |
257 | struct MHD_Daemon *d; | 257 | struct MHD_Daemon *d; |
258 | CURL *c; | 258 | CURL *c; |
259 | struct CBC cbc; | 259 | struct CBC cbc; |
260 | CURLcode errornum; | 260 | CURLcode errornum; |
261 | int port; | 261 | uint16_t port; |
262 | 262 | ||
263 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 263 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
264 | port = 0; | 264 | port = 0; |
@@ -294,7 +294,7 @@ testInternalGet (bool contiguous) | |||
294 | { | 294 | { |
295 | MHD_stop_daemon (d); return 32; | 295 | MHD_stop_daemon (d); return 32; |
296 | } | 296 | } |
297 | port = (int) dinfo->port; | 297 | port = dinfo->port; |
298 | } | 298 | } |
299 | c = curl_easy_init (); | 299 | c = curl_easy_init (); |
300 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/"); | 300 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/"); |
@@ -331,14 +331,14 @@ testInternalGet (bool contiguous) | |||
331 | } | 331 | } |
332 | 332 | ||
333 | 333 | ||
334 | static int | 334 | static unsigned int |
335 | testMultithreadedGet (void) | 335 | testMultithreadedGet (void) |
336 | { | 336 | { |
337 | struct MHD_Daemon *d; | 337 | struct MHD_Daemon *d; |
338 | CURL *c; | 338 | CURL *c; |
339 | struct CBC cbc; | 339 | struct CBC cbc; |
340 | CURLcode errornum; | 340 | CURLcode errornum; |
341 | int port; | 341 | uint16_t port; |
342 | 342 | ||
343 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 343 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
344 | port = 0; | 344 | port = 0; |
@@ -366,7 +366,7 @@ testMultithreadedGet (void) | |||
366 | { | 366 | { |
367 | MHD_stop_daemon (d); return 32; | 367 | MHD_stop_daemon (d); return 32; |
368 | } | 368 | } |
369 | port = (int) dinfo->port; | 369 | port = dinfo->port; |
370 | } | 370 | } |
371 | c = curl_easy_init (); | 371 | c = curl_easy_init (); |
372 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/"); | 372 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/"); |
@@ -403,14 +403,14 @@ testMultithreadedGet (void) | |||
403 | } | 403 | } |
404 | 404 | ||
405 | 405 | ||
406 | static int | 406 | static unsigned int |
407 | testMultithreadedPoolGet (void) | 407 | testMultithreadedPoolGet (void) |
408 | { | 408 | { |
409 | struct MHD_Daemon *d; | 409 | struct MHD_Daemon *d; |
410 | CURL *c; | 410 | CURL *c; |
411 | struct CBC cbc; | 411 | struct CBC cbc; |
412 | CURLcode errornum; | 412 | CURLcode errornum; |
413 | int port; | 413 | uint16_t port; |
414 | 414 | ||
415 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 415 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
416 | port = 0; | 416 | port = 0; |
@@ -439,7 +439,7 @@ testMultithreadedPoolGet (void) | |||
439 | { | 439 | { |
440 | MHD_stop_daemon (d); return 32; | 440 | MHD_stop_daemon (d); return 32; |
441 | } | 441 | } |
442 | port = (int) dinfo->port; | 442 | port = dinfo->port; |
443 | } | 443 | } |
444 | c = curl_easy_init (); | 444 | c = curl_easy_init (); |
445 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/"); | 445 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/"); |
@@ -476,7 +476,7 @@ testMultithreadedPoolGet (void) | |||
476 | } | 476 | } |
477 | 477 | ||
478 | 478 | ||
479 | static int | 479 | static unsigned int |
480 | testExternalGet (void) | 480 | testExternalGet (void) |
481 | { | 481 | { |
482 | struct MHD_Daemon *d; | 482 | struct MHD_Daemon *d; |
@@ -497,7 +497,7 @@ testExternalGet (void) | |||
497 | struct CURLMsg *msg; | 497 | struct CURLMsg *msg; |
498 | time_t start; | 498 | time_t start; |
499 | struct timeval tv; | 499 | struct timeval tv; |
500 | int port; | 500 | uint16_t port; |
501 | 501 | ||
502 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 502 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
503 | port = 0; | 503 | port = 0; |
@@ -524,7 +524,7 @@ testExternalGet (void) | |||
524 | { | 524 | { |
525 | MHD_stop_daemon (d); return 32; | 525 | MHD_stop_daemon (d); return 32; |
526 | } | 526 | } |
527 | port = (int) dinfo->port; | 527 | port = dinfo->port; |
528 | } | 528 | } |
529 | c = curl_easy_init (); | 529 | c = curl_easy_init (); |
530 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/"); | 530 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/"); |
@@ -659,7 +659,7 @@ testExternalGet (void) | |||
659 | } | 659 | } |
660 | 660 | ||
661 | 661 | ||
662 | static int | 662 | static unsigned int |
663 | testUnknownPortGet (void) | 663 | testUnknownPortGet (void) |
664 | { | 664 | { |
665 | struct MHD_Daemon *d; | 665 | struct MHD_Daemon *d; |
@@ -667,7 +667,7 @@ testUnknownPortGet (void) | |||
667 | CURL *c; | 667 | CURL *c; |
668 | struct CBC cbc; | 668 | struct CBC cbc; |
669 | CURLcode errornum; | 669 | CURLcode errornum; |
670 | int port; | 670 | uint16_t port; |
671 | char buf[2048]; | 671 | char buf[2048]; |
672 | 672 | ||
673 | struct sockaddr_in addr; | 673 | struct sockaddr_in addr; |
@@ -698,7 +698,7 @@ testUnknownPortGet (void) | |||
698 | 698 | ||
699 | if (addr.sin_family != AF_INET) | 699 | if (addr.sin_family != AF_INET) |
700 | return 26214; | 700 | return 26214; |
701 | port = (int) ntohs (addr.sin_port); | 701 | port = ntohs (addr.sin_port); |
702 | } | 702 | } |
703 | else | 703 | else |
704 | { | 704 | { |
@@ -708,11 +708,11 @@ testUnknownPortGet (void) | |||
708 | { | 708 | { |
709 | MHD_stop_daemon (d); return 32; | 709 | MHD_stop_daemon (d); return 32; |
710 | } | 710 | } |
711 | port = (int) dinfo->port; | 711 | port = dinfo->port; |
712 | } | 712 | } |
713 | 713 | ||
714 | snprintf (buf, sizeof(buf), "http://127.0.0.1:%d/", | 714 | snprintf (buf, sizeof(buf), "http://127.0.0.1:%u/", |
715 | port); | 715 | (unsigned int) port); |
716 | 716 | ||
717 | c = curl_easy_init (); | 717 | c = curl_easy_init (); |
718 | curl_easy_setopt (c, CURLOPT_URL, buf); | 718 | curl_easy_setopt (c, CURLOPT_URL, buf); |
diff --git a/src/testcurl/test_get_response_cleanup.c b/src/testcurl/test_get_response_cleanup.c index dee0806c..442f9f25 100644 --- a/src/testcurl/test_get_response_cleanup.c +++ b/src/testcurl/test_get_response_cleanup.c | |||
@@ -152,12 +152,12 @@ ahc_echo (void *cls, | |||
152 | } | 152 | } |
153 | 153 | ||
154 | 154 | ||
155 | static int | 155 | static unsigned int |
156 | testInternalGet (void) | 156 | testInternalGet (void) |
157 | { | 157 | { |
158 | struct MHD_Daemon *d; | 158 | struct MHD_Daemon *d; |
159 | pid_t curl; | 159 | pid_t curl; |
160 | int port; | 160 | uint16_t port; |
161 | char url[127]; | 161 | char url[127]; |
162 | 162 | ||
163 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 163 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
@@ -182,12 +182,12 @@ testInternalGet (void) | |||
182 | { | 182 | { |
183 | MHD_stop_daemon (d); return 32; | 183 | MHD_stop_daemon (d); return 32; |
184 | } | 184 | } |
185 | port = (int) dinfo->port; | 185 | port = dinfo->port; |
186 | } | 186 | } |
187 | snprintf (url, | 187 | snprintf (url, |
188 | sizeof (url), | 188 | sizeof (url), |
189 | "http://127.0.0.1:%d/", | 189 | "http://127.0.0.1:%u/", |
190 | port); | 190 | (unsigned int) port); |
191 | curl = fork_curl (url); | 191 | curl = fork_curl (url); |
192 | (void) sleep (1); | 192 | (void) sleep (1); |
193 | kill_curl (curl); | 193 | kill_curl (curl); |
@@ -200,12 +200,12 @@ testInternalGet (void) | |||
200 | } | 200 | } |
201 | 201 | ||
202 | 202 | ||
203 | static int | 203 | static unsigned int |
204 | testMultithreadedGet (void) | 204 | testMultithreadedGet (void) |
205 | { | 205 | { |
206 | struct MHD_Daemon *d; | 206 | struct MHD_Daemon *d; |
207 | pid_t curl; | 207 | pid_t curl; |
208 | int port; | 208 | uint16_t port; |
209 | char url[127]; | 209 | char url[127]; |
210 | 210 | ||
211 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 211 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
@@ -233,12 +233,12 @@ testMultithreadedGet (void) | |||
233 | { | 233 | { |
234 | MHD_stop_daemon (d); return 32; | 234 | MHD_stop_daemon (d); return 32; |
235 | } | 235 | } |
236 | port = (int) dinfo->port; | 236 | port = dinfo->port; |
237 | } | 237 | } |
238 | snprintf (url, | 238 | snprintf (url, |
239 | sizeof (url), | 239 | sizeof (url), |
240 | "http://127.0.0.1:%d/", | 240 | "http://127.0.0.1:%u/", |
241 | port); | 241 | (unsigned int) port); |
242 | // fprintf (stderr, "Forking cURL!\n"); | 242 | // fprintf (stderr, "Forking cURL!\n"); |
243 | curl = fork_curl (url); | 243 | curl = fork_curl (url); |
244 | (void) sleep (1); | 244 | (void) sleep (1); |
@@ -263,12 +263,12 @@ testMultithreadedGet (void) | |||
263 | } | 263 | } |
264 | 264 | ||
265 | 265 | ||
266 | static int | 266 | static unsigned int |
267 | testMultithreadedPoolGet (void) | 267 | testMultithreadedPoolGet (void) |
268 | { | 268 | { |
269 | struct MHD_Daemon *d; | 269 | struct MHD_Daemon *d; |
270 | pid_t curl; | 270 | pid_t curl; |
271 | int port; | 271 | uint16_t port; |
272 | char url[127]; | 272 | char url[127]; |
273 | 273 | ||
274 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 274 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
@@ -295,12 +295,12 @@ testMultithreadedPoolGet (void) | |||
295 | { | 295 | { |
296 | MHD_stop_daemon (d); return 32; | 296 | MHD_stop_daemon (d); return 32; |
297 | } | 297 | } |
298 | port = (int) dinfo->port; | 298 | port = dinfo->port; |
299 | } | 299 | } |
300 | snprintf (url, | 300 | snprintf (url, |
301 | sizeof (url), | 301 | sizeof (url), |
302 | "http://127.0.0.1:%d/", | 302 | "http://127.0.0.1:%u/", |
303 | port); | 303 | (unsigned int) port); |
304 | curl = fork_curl (url); | 304 | curl = fork_curl (url); |
305 | (void) sleep (1); | 305 | (void) sleep (1); |
306 | kill_curl (curl); | 306 | kill_curl (curl); |
@@ -313,7 +313,7 @@ testMultithreadedPoolGet (void) | |||
313 | } | 313 | } |
314 | 314 | ||
315 | 315 | ||
316 | static int | 316 | static unsigned int |
317 | testExternalGet (void) | 317 | testExternalGet (void) |
318 | { | 318 | { |
319 | struct MHD_Daemon *d; | 319 | struct MHD_Daemon *d; |
@@ -324,7 +324,7 @@ testExternalGet (void) | |||
324 | time_t start; | 324 | time_t start; |
325 | struct timeval tv; | 325 | struct timeval tv; |
326 | pid_t curl; | 326 | pid_t curl; |
327 | int port; | 327 | uint16_t port; |
328 | char url[127]; | 328 | char url[127]; |
329 | 329 | ||
330 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 330 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
@@ -349,12 +349,12 @@ testExternalGet (void) | |||
349 | { | 349 | { |
350 | MHD_stop_daemon (d); return 32; | 350 | MHD_stop_daemon (d); return 32; |
351 | } | 351 | } |
352 | port = (int) dinfo->port; | 352 | port = dinfo->port; |
353 | } | 353 | } |
354 | snprintf (url, | 354 | snprintf (url, |
355 | sizeof (url), | 355 | sizeof (url), |
356 | "http://127.0.0.1:%d/", | 356 | "http://127.0.0.1:%u/", |
357 | port); | 357 | (unsigned int) port); |
358 | curl = fork_curl (url); | 358 | curl = fork_curl (url); |
359 | 359 | ||
360 | start = time (NULL); | 360 | start = time (NULL); |
diff --git a/src/testcurl/test_get_sendfile.c b/src/testcurl/test_get_sendfile.c index 897af245..3e424b10 100644 --- a/src/testcurl/test_get_sendfile.c +++ b/src/testcurl/test_get_sendfile.c | |||
@@ -119,7 +119,7 @@ ahc_echo (void *cls, | |||
119 | } | 119 | } |
120 | 120 | ||
121 | 121 | ||
122 | static int | 122 | static unsigned int |
123 | testInternalGet (void) | 123 | testInternalGet (void) |
124 | { | 124 | { |
125 | struct MHD_Daemon *d; | 125 | struct MHD_Daemon *d; |
@@ -127,7 +127,7 @@ testInternalGet (void) | |||
127 | char buf[2048]; | 127 | char buf[2048]; |
128 | struct CBC cbc; | 128 | struct CBC cbc; |
129 | CURLcode errornum; | 129 | CURLcode errornum; |
130 | int port; | 130 | uint16_t port; |
131 | 131 | ||
132 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 132 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
133 | port = 0; | 133 | port = 0; |
@@ -153,7 +153,7 @@ testInternalGet (void) | |||
153 | { | 153 | { |
154 | MHD_stop_daemon (d); return 32; | 154 | MHD_stop_daemon (d); return 32; |
155 | } | 155 | } |
156 | port = (int) dinfo->port; | 156 | port = dinfo->port; |
157 | } | 157 | } |
158 | c = curl_easy_init (); | 158 | c = curl_easy_init (); |
159 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/"); | 159 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/"); |
@@ -190,7 +190,7 @@ testInternalGet (void) | |||
190 | } | 190 | } |
191 | 191 | ||
192 | 192 | ||
193 | static int | 193 | static unsigned int |
194 | testMultithreadedGet (void) | 194 | testMultithreadedGet (void) |
195 | { | 195 | { |
196 | struct MHD_Daemon *d; | 196 | struct MHD_Daemon *d; |
@@ -198,7 +198,7 @@ testMultithreadedGet (void) | |||
198 | char buf[2048]; | 198 | char buf[2048]; |
199 | struct CBC cbc; | 199 | struct CBC cbc; |
200 | CURLcode errornum; | 200 | CURLcode errornum; |
201 | int port; | 201 | uint16_t port; |
202 | 202 | ||
203 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 203 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
204 | port = 0; | 204 | port = 0; |
@@ -225,7 +225,7 @@ testMultithreadedGet (void) | |||
225 | { | 225 | { |
226 | MHD_stop_daemon (d); return 32; | 226 | MHD_stop_daemon (d); return 32; |
227 | } | 227 | } |
228 | port = (int) dinfo->port; | 228 | port = dinfo->port; |
229 | } | 229 | } |
230 | c = curl_easy_init (); | 230 | c = curl_easy_init (); |
231 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/"); | 231 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/"); |
@@ -262,7 +262,7 @@ testMultithreadedGet (void) | |||
262 | } | 262 | } |
263 | 263 | ||
264 | 264 | ||
265 | static int | 265 | static unsigned int |
266 | testMultithreadedPoolGet (void) | 266 | testMultithreadedPoolGet (void) |
267 | { | 267 | { |
268 | struct MHD_Daemon *d; | 268 | struct MHD_Daemon *d; |
@@ -270,7 +270,7 @@ testMultithreadedPoolGet (void) | |||
270 | char buf[2048]; | 270 | char buf[2048]; |
271 | struct CBC cbc; | 271 | struct CBC cbc; |
272 | CURLcode errornum; | 272 | CURLcode errornum; |
273 | int port; | 273 | uint16_t port; |
274 | 274 | ||
275 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 275 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
276 | port = 0; | 276 | port = 0; |
@@ -298,7 +298,7 @@ testMultithreadedPoolGet (void) | |||
298 | { | 298 | { |
299 | MHD_stop_daemon (d); return 32; | 299 | MHD_stop_daemon (d); return 32; |
300 | } | 300 | } |
301 | port = (int) dinfo->port; | 301 | port = dinfo->port; |
302 | } | 302 | } |
303 | c = curl_easy_init (); | 303 | c = curl_easy_init (); |
304 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/"); | 304 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/"); |
@@ -335,7 +335,7 @@ testMultithreadedPoolGet (void) | |||
335 | } | 335 | } |
336 | 336 | ||
337 | 337 | ||
338 | static int | 338 | static unsigned int |
339 | testExternalGet (void) | 339 | testExternalGet (void) |
340 | { | 340 | { |
341 | struct MHD_Daemon *d; | 341 | struct MHD_Daemon *d; |
@@ -357,7 +357,7 @@ testExternalGet (void) | |||
357 | struct CURLMsg *msg; | 357 | struct CURLMsg *msg; |
358 | time_t start; | 358 | time_t start; |
359 | struct timeval tv; | 359 | struct timeval tv; |
360 | int port; | 360 | uint16_t port; |
361 | 361 | ||
362 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 362 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
363 | port = 0; | 363 | port = 0; |
@@ -384,7 +384,7 @@ testExternalGet (void) | |||
384 | { | 384 | { |
385 | MHD_stop_daemon (d); return 32; | 385 | MHD_stop_daemon (d); return 32; |
386 | } | 386 | } |
387 | port = (int) dinfo->port; | 387 | port = dinfo->port; |
388 | } | 388 | } |
389 | c = curl_easy_init (); | 389 | c = curl_easy_init (); |
390 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/"); | 390 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/"); |
@@ -526,7 +526,7 @@ testExternalGet (void) | |||
526 | } | 526 | } |
527 | 527 | ||
528 | 528 | ||
529 | static int | 529 | static unsigned int |
530 | testUnknownPortGet (void) | 530 | testUnknownPortGet (void) |
531 | { | 531 | { |
532 | struct MHD_Daemon *d; | 532 | struct MHD_Daemon *d; |
@@ -535,7 +535,7 @@ testUnknownPortGet (void) | |||
535 | char buf[2048]; | 535 | char buf[2048]; |
536 | struct CBC cbc; | 536 | struct CBC cbc; |
537 | CURLcode errornum; | 537 | CURLcode errornum; |
538 | int port; | 538 | uint16_t port; |
539 | 539 | ||
540 | struct sockaddr_in addr; | 540 | struct sockaddr_in addr; |
541 | socklen_t addr_len = sizeof(addr); | 541 | socklen_t addr_len = sizeof(addr); |
@@ -565,7 +565,7 @@ testUnknownPortGet (void) | |||
565 | 565 | ||
566 | if (addr.sin_family != AF_INET) | 566 | if (addr.sin_family != AF_INET) |
567 | return 26214; | 567 | return 26214; |
568 | port = (int) ntohs (addr.sin_port); | 568 | port = (uint16_t) ntohs (addr.sin_port); |
569 | } | 569 | } |
570 | else | 570 | else |
571 | { | 571 | { |
@@ -575,11 +575,11 @@ testUnknownPortGet (void) | |||
575 | { | 575 | { |
576 | MHD_stop_daemon (d); return 32; | 576 | MHD_stop_daemon (d); return 32; |
577 | } | 577 | } |
578 | port = (int) dinfo->port; | 578 | port = dinfo->port; |
579 | } | 579 | } |
580 | 580 | ||
581 | snprintf (buf, sizeof(buf), "http://127.0.0.1:%d/", | 581 | snprintf (buf, sizeof(buf), "http://127.0.0.1:%u/", |
582 | port); | 582 | (unsigned int) port); |
583 | 583 | ||
584 | c = curl_easy_init (); | 584 | c = curl_easy_init (); |
585 | curl_easy_setopt (c, CURLOPT_URL, buf); | 585 | curl_easy_setopt (c, CURLOPT_URL, buf); |
diff --git a/src/testcurl/test_get_wait.c b/src/testcurl/test_get_wait.c index b2938fdf..a382a798 100644 --- a/src/testcurl/test_get_wait.c +++ b/src/testcurl/test_get_wait.c | |||
@@ -116,12 +116,12 @@ thread_gets (void *param) | |||
116 | CURLcode errornum; | 116 | CURLcode errornum; |
117 | unsigned int i; | 117 | unsigned int i; |
118 | char url[64]; | 118 | char url[64]; |
119 | int port = (int) (intptr_t) param; | 119 | uint16_t port = (uint16_t) (intptr_t) param; |
120 | 120 | ||
121 | snprintf (url, | 121 | snprintf (url, |
122 | sizeof (url), | 122 | sizeof (url), |
123 | "http://127.0.0.1:%d/hello_world", | 123 | "http://127.0.0.1:%u/hello_world", |
124 | port); | 124 | (unsigned int) port); |
125 | 125 | ||
126 | c = curl_easy_init (); | 126 | c = curl_easy_init (); |
127 | if (NULL == c) | 127 | if (NULL == c) |
@@ -156,8 +156,8 @@ thread_gets (void *param) | |||
156 | } | 156 | } |
157 | 157 | ||
158 | 158 | ||
159 | static int | 159 | static unsigned int |
160 | testRunWaitGet (int port, int poll_flag) | 160 | testRunWaitGet (uint16_t port, uint32_t poll_flag) |
161 | { | 161 | { |
162 | pthread_t get_tid; | 162 | pthread_t get_tid; |
163 | struct MHD_Daemon *d; | 163 | struct MHD_Daemon *d; |
@@ -175,7 +175,7 @@ testRunWaitGet (int port, int poll_flag) | |||
175 | printf ("Starting MHD_run_wait() test with MHD in %s polling mode.\n", | 175 | printf ("Starting MHD_run_wait() test with MHD in %s polling mode.\n", |
176 | test_desc); | 176 | test_desc); |
177 | signal_done = 0; | 177 | signal_done = 0; |
178 | d = MHD_start_daemon (MHD_USE_ERROR_LOG | poll_flag, | 178 | d = MHD_start_daemon (MHD_USE_ERROR_LOG | (enum MHD_FLAG) poll_flag, |
179 | port, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END); | 179 | port, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END); |
180 | if (d == NULL) | 180 | if (d == NULL) |
181 | abort (); | 181 | abort (); |
@@ -185,7 +185,7 @@ testRunWaitGet (int port, int poll_flag) | |||
185 | dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT); | 185 | dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT); |
186 | if ((NULL == dinfo) || (0 == dinfo->port) ) | 186 | if ((NULL == dinfo) || (0 == dinfo->port) ) |
187 | abort (); | 187 | abort (); |
188 | port = (int) dinfo->port; | 188 | port = dinfo->port; |
189 | } | 189 | } |
190 | 190 | ||
191 | if (0 != pthread_create (&get_tid, NULL, | 191 | if (0 != pthread_create (&get_tid, NULL, |
@@ -214,7 +214,7 @@ testRunWaitGet (int port, int poll_flag) | |||
214 | int | 214 | int |
215 | main (int argc, char *const *argv) | 215 | main (int argc, char *const *argv) |
216 | { | 216 | { |
217 | int port = 1675; | 217 | uint16_t port = 1675; |
218 | (void) argc; /* Unused. Silent compiler warning. */ | 218 | (void) argc; /* Unused. Silent compiler warning. */ |
219 | 219 | ||
220 | if ((NULL == argv) || (0 == argv[0])) | 220 | if ((NULL == argv) || (0 == argv[0])) |
diff --git a/src/testcurl/test_head.c b/src/testcurl/test_head.c index f435a4f4..6ce78217 100644 --- a/src/testcurl/test_head.c +++ b/src/testcurl/test_head.c | |||
@@ -435,7 +435,7 @@ setCURL_rq_path (CURL *c, int uri_exist) | |||
435 | 435 | ||
436 | 436 | ||
437 | static CURL * | 437 | static CURL * |
438 | setupCURL (void *cbc, unsigned int port, | 438 | setupCURL (void *cbc, uint16_t port, |
439 | struct headers_check_result *hdr_chk_result) | 439 | struct headers_check_result *hdr_chk_result) |
440 | { | 440 | { |
441 | CURL *c; | 441 | CURL *c; |
@@ -715,7 +715,7 @@ testHead (void) | |||
715 | cbc.size = sizeof (buf); | 715 | cbc.size = sizeof (buf); |
716 | cbc.pos = 0; | 716 | cbc.pos = 0; |
717 | memset (cbc.buf, 0, cbc.size); | 717 | memset (cbc.buf, 0, cbc.size); |
718 | c = setupCURL (&cbc, (unsigned int) port, &rp_headers_check); | 718 | c = setupCURL (&cbc, port, &rp_headers_check); |
719 | setCURL_rq_path (c, 1); | 719 | setCURL_rq_path (c, 1); |
720 | multi_reuse = NULL; | 720 | multi_reuse = NULL; |
721 | /* First request */ | 721 | /* First request */ |
diff --git a/src/testcurl/test_iplimit.c b/src/testcurl/test_iplimit.c index 1e747f0c..f60876e3 100644 --- a/src/testcurl/test_iplimit.c +++ b/src/testcurl/test_iplimit.c | |||
@@ -108,7 +108,7 @@ ahc_echo (void *cls, | |||
108 | } | 108 | } |
109 | 109 | ||
110 | 110 | ||
111 | static int | 111 | static unsigned int |
112 | testMultithreadedGet (void) | 112 | testMultithreadedGet (void) |
113 | { | 113 | { |
114 | struct MHD_Daemon *d; | 114 | struct MHD_Daemon *d; |
@@ -116,7 +116,7 @@ testMultithreadedGet (void) | |||
116 | int k; | 116 | int k; |
117 | unsigned int success; | 117 | unsigned int success; |
118 | unsigned int failure; | 118 | unsigned int failure; |
119 | int port; | 119 | uint16_t port; |
120 | 120 | ||
121 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 121 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
122 | port = 0; | 122 | port = 0; |
@@ -146,7 +146,7 @@ testMultithreadedGet (void) | |||
146 | { | 146 | { |
147 | MHD_stop_daemon (d); return 32; | 147 | MHD_stop_daemon (d); return 32; |
148 | } | 148 | } |
149 | port = (int) dinfo->port; | 149 | port = dinfo->port; |
150 | } | 150 | } |
151 | 151 | ||
152 | for (k = 0; k < 3; ++k) | 152 | for (k = 0; k < 3; ++k) |
@@ -223,13 +223,13 @@ testMultithreadedGet (void) | |||
223 | } | 223 | } |
224 | 224 | ||
225 | 225 | ||
226 | static int | 226 | static unsigned int |
227 | testMultithreadedPoolGet (void) | 227 | testMultithreadedPoolGet (void) |
228 | { | 228 | { |
229 | struct MHD_Daemon *d; | 229 | struct MHD_Daemon *d; |
230 | char buf[2048]; | 230 | char buf[2048]; |
231 | int k; | 231 | int k; |
232 | int port; | 232 | uint16_t port; |
233 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 233 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
234 | port = 0; | 234 | port = 0; |
235 | else | 235 | else |
@@ -258,7 +258,7 @@ testMultithreadedPoolGet (void) | |||
258 | { | 258 | { |
259 | MHD_stop_daemon (d); return 32; | 259 | MHD_stop_daemon (d); return 32; |
260 | } | 260 | } |
261 | port = (int) dinfo->port; | 261 | port = dinfo->port; |
262 | } | 262 | } |
263 | 263 | ||
264 | for (k = 0; k < 3; ++k) | 264 | for (k = 0; k < 3; ++k) |
diff --git a/src/testcurl/test_large_put.c b/src/testcurl/test_large_put.c index 8a597c28..c46e120a 100644 --- a/src/testcurl/test_large_put.c +++ b/src/testcurl/test_large_put.c | |||
@@ -297,7 +297,7 @@ ahc_echo (void *cls, | |||
297 | } | 297 | } |
298 | 298 | ||
299 | 299 | ||
300 | static int | 300 | static unsigned int |
301 | testPutInternalThread (unsigned int add_flag) | 301 | testPutInternalThread (unsigned int add_flag) |
302 | { | 302 | { |
303 | struct MHD_Daemon *d; | 303 | struct MHD_Daemon *d; |
@@ -307,7 +307,7 @@ testPutInternalThread (unsigned int add_flag) | |||
307 | int done_flag = 0; | 307 | int done_flag = 0; |
308 | CURLcode errornum; | 308 | CURLcode errornum; |
309 | char buf[2048]; | 309 | char buf[2048]; |
310 | int port; | 310 | uint16_t port; |
311 | 311 | ||
312 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 312 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
313 | port = 0; | 313 | port = 0; |
@@ -338,7 +338,7 @@ testPutInternalThread (unsigned int add_flag) | |||
338 | dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT); | 338 | dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT); |
339 | if ((NULL == dinfo) || (0 == dinfo->port) ) | 339 | if ((NULL == dinfo) || (0 == dinfo->port) ) |
340 | mhdErrorExit (); | 340 | mhdErrorExit (); |
341 | port = (int) dinfo->port; | 341 | port = dinfo->port; |
342 | } | 342 | } |
343 | 343 | ||
344 | c = curl_easy_init (); | 344 | c = curl_easy_init (); |
@@ -402,7 +402,7 @@ testPutInternalThread (unsigned int add_flag) | |||
402 | } | 402 | } |
403 | 403 | ||
404 | 404 | ||
405 | static int | 405 | static unsigned int |
406 | testPutThreadPerConn (unsigned int add_flag) | 406 | testPutThreadPerConn (unsigned int add_flag) |
407 | { | 407 | { |
408 | struct MHD_Daemon *d; | 408 | struct MHD_Daemon *d; |
@@ -412,7 +412,7 @@ testPutThreadPerConn (unsigned int add_flag) | |||
412 | int done_flag = 0; | 412 | int done_flag = 0; |
413 | CURLcode errornum; | 413 | CURLcode errornum; |
414 | char buf[2048]; | 414 | char buf[2048]; |
415 | int port; | 415 | uint16_t port; |
416 | 416 | ||
417 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 417 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
418 | port = 0; | 418 | port = 0; |
@@ -444,7 +444,7 @@ testPutThreadPerConn (unsigned int add_flag) | |||
444 | dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT); | 444 | dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT); |
445 | if ((NULL == dinfo) || (0 == dinfo->port) ) | 445 | if ((NULL == dinfo) || (0 == dinfo->port) ) |
446 | mhdErrorExit (); | 446 | mhdErrorExit (); |
447 | port = (int) dinfo->port; | 447 | port = dinfo->port; |
448 | } | 448 | } |
449 | 449 | ||
450 | c = curl_easy_init (); | 450 | c = curl_easy_init (); |
@@ -507,7 +507,7 @@ testPutThreadPerConn (unsigned int add_flag) | |||
507 | } | 507 | } |
508 | 508 | ||
509 | 509 | ||
510 | static int | 510 | static unsigned int |
511 | testPutThreadPool (unsigned int add_flag) | 511 | testPutThreadPool (unsigned int add_flag) |
512 | { | 512 | { |
513 | struct MHD_Daemon *d; | 513 | struct MHD_Daemon *d; |
@@ -517,7 +517,7 @@ testPutThreadPool (unsigned int add_flag) | |||
517 | int done_flag = 0; | 517 | int done_flag = 0; |
518 | CURLcode errornum; | 518 | CURLcode errornum; |
519 | char buf[2048]; | 519 | char buf[2048]; |
520 | int port; | 520 | uint16_t port; |
521 | 521 | ||
522 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 522 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
523 | port = 0; | 523 | port = 0; |
@@ -549,7 +549,7 @@ testPutThreadPool (unsigned int add_flag) | |||
549 | dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT); | 549 | dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT); |
550 | if ((NULL == dinfo) || (0 == dinfo->port) ) | 550 | if ((NULL == dinfo) || (0 == dinfo->port) ) |
551 | mhdErrorExit (); | 551 | mhdErrorExit (); |
552 | port = (int) dinfo->port; | 552 | port = dinfo->port; |
553 | } | 553 | } |
554 | 554 | ||
555 | c = curl_easy_init (); | 555 | c = curl_easy_init (); |
@@ -611,7 +611,7 @@ testPutThreadPool (unsigned int add_flag) | |||
611 | } | 611 | } |
612 | 612 | ||
613 | 613 | ||
614 | static int | 614 | static unsigned int |
615 | testPutExternal (void) | 615 | testPutExternal (void) |
616 | { | 616 | { |
617 | struct MHD_Daemon *d; | 617 | struct MHD_Daemon *d; |
@@ -629,7 +629,7 @@ testPutExternal (void) | |||
629 | size_t pos = 0; | 629 | size_t pos = 0; |
630 | int done_flag = 0; | 630 | int done_flag = 0; |
631 | char buf[2048]; | 631 | char buf[2048]; |
632 | int port; | 632 | uint16_t port; |
633 | 633 | ||
634 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 634 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
635 | port = 0; | 635 | port = 0; |
@@ -660,7 +660,7 @@ testPutExternal (void) | |||
660 | dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT); | 660 | dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT); |
661 | if ((NULL == dinfo) || (0 == dinfo->port) ) | 661 | if ((NULL == dinfo) || (0 == dinfo->port) ) |
662 | mhdErrorExit (); | 662 | mhdErrorExit (); |
663 | port = (int) dinfo->port; | 663 | port = dinfo->port; |
664 | } | 664 | } |
665 | 665 | ||
666 | c = curl_easy_init (); | 666 | c = curl_easy_init (); |
diff --git a/src/testcurl/test_long_header.c b/src/testcurl/test_long_header.c index c1d07cb3..6ed8d78d 100644 --- a/src/testcurl/test_long_header.c +++ b/src/testcurl/test_long_header.c | |||
@@ -96,7 +96,7 @@ ahc_echo (void *cls, | |||
96 | } | 96 | } |
97 | 97 | ||
98 | 98 | ||
99 | static int | 99 | static unsigned int |
100 | testLongUrlGet (size_t buff_size) | 100 | testLongUrlGet (size_t buff_size) |
101 | { | 101 | { |
102 | struct MHD_Daemon *d; | 102 | struct MHD_Daemon *d; |
@@ -105,13 +105,13 @@ testLongUrlGet (size_t buff_size) | |||
105 | struct CBC cbc; | 105 | struct CBC cbc; |
106 | char *url; | 106 | char *url; |
107 | long code; | 107 | long code; |
108 | int port; | 108 | uint16_t port; |
109 | 109 | ||
110 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 110 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
111 | port = 0; | 111 | port = 0; |
112 | else | 112 | else |
113 | { | 113 | { |
114 | port = 1330 + buff_size % 20; | 114 | port = 1330 + (uint16_t) (buff_size % 20); |
115 | if (oneone) | 115 | if (oneone) |
116 | port += 5; | 116 | port += 5; |
117 | } | 117 | } |
@@ -136,7 +136,7 @@ testLongUrlGet (size_t buff_size) | |||
136 | { | 136 | { |
137 | MHD_stop_daemon (d); return 32; | 137 | MHD_stop_daemon (d); return 32; |
138 | } | 138 | } |
139 | port = (int) dinfo->port; | 139 | port = dinfo->port; |
140 | } | 140 | } |
141 | c = curl_easy_init (); | 141 | c = curl_easy_init (); |
142 | url = malloc (VERY_LONG); | 142 | url = malloc (VERY_LONG); |
@@ -187,7 +187,7 @@ testLongUrlGet (size_t buff_size) | |||
187 | } | 187 | } |
188 | 188 | ||
189 | 189 | ||
190 | static int | 190 | static unsigned int |
191 | testLongHeaderGet (size_t buff_size) | 191 | testLongHeaderGet (size_t buff_size) |
192 | { | 192 | { |
193 | struct MHD_Daemon *d; | 193 | struct MHD_Daemon *d; |
@@ -197,13 +197,13 @@ testLongHeaderGet (size_t buff_size) | |||
197 | char *url; | 197 | char *url; |
198 | long code; | 198 | long code; |
199 | struct curl_slist *header = NULL; | 199 | struct curl_slist *header = NULL; |
200 | int port; | 200 | uint16_t port; |
201 | 201 | ||
202 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 202 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
203 | port = 0; | 203 | port = 0; |
204 | else | 204 | else |
205 | { | 205 | { |
206 | port = 1331 + buff_size % 20; | 206 | port = 1331 + (uint16_t) (buff_size % 20); |
207 | if (oneone) | 207 | if (oneone) |
208 | port += 5; | 208 | port += 5; |
209 | } | 209 | } |
@@ -229,7 +229,7 @@ testLongHeaderGet (size_t buff_size) | |||
229 | { | 229 | { |
230 | MHD_stop_daemon (d); return 32; | 230 | MHD_stop_daemon (d); return 32; |
231 | } | 231 | } |
232 | port = (int) dinfo->port; | 232 | port = dinfo->port; |
233 | } | 233 | } |
234 | c = curl_easy_init (); | 234 | c = curl_easy_init (); |
235 | url = malloc (VERY_LONG); | 235 | url = malloc (VERY_LONG); |
diff --git a/src/testcurl/test_parse_cookies.c b/src/testcurl/test_parse_cookies.c index 7de83c32..835e8934 100644 --- a/src/testcurl/test_parse_cookies.c +++ b/src/testcurl/test_parse_cookies.c | |||
@@ -146,7 +146,7 @@ ahc_echo (void *cls, | |||
146 | 146 | ||
147 | 147 | ||
148 | /* Re-use the same port for all checks */ | 148 | /* Re-use the same port for all checks */ |
149 | static unsigned int port; | 149 | static uint16_t port; |
150 | 150 | ||
151 | static unsigned int | 151 | static unsigned int |
152 | testExternalGet (int test_number) | 152 | testExternalGet (int test_number) |
@@ -188,7 +188,7 @@ testExternalGet (int test_number) | |||
188 | { | 188 | { |
189 | MHD_stop_daemon (d); return 32; | 189 | MHD_stop_daemon (d); return 32; |
190 | } | 190 | } |
191 | port = (int) dinfo->port; | 191 | port = dinfo->port; |
192 | } | 192 | } |
193 | c = curl_easy_init (); | 193 | c = curl_easy_init (); |
194 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); | 194 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); |
diff --git a/src/testcurl/test_patch.c b/src/testcurl/test_patch.c index ffdbf229..d5608335 100644 --- a/src/testcurl/test_patch.c +++ b/src/testcurl/test_patch.c | |||
@@ -58,8 +58,8 @@ struct CBC | |||
58 | static size_t | 58 | static size_t |
59 | putBuffer (void *stream, size_t size, size_t nmemb, void *ptr) | 59 | putBuffer (void *stream, size_t size, size_t nmemb, void *ptr) |
60 | { | 60 | { |
61 | unsigned int *pos = ptr; | 61 | size_t *pos = ptr; |
62 | unsigned int wrt; | 62 | size_t wrt; |
63 | 63 | ||
64 | wrt = size * nmemb; | 64 | wrt = size * nmemb; |
65 | if (wrt > 8 - (*pos)) | 65 | if (wrt > 8 - (*pos)) |
@@ -126,7 +126,7 @@ ahc_echo (void *cls, | |||
126 | static CURL * | 126 | static CURL * |
127 | setup_curl (long port, | 127 | setup_curl (long port, |
128 | struct CBC *cbc, | 128 | struct CBC *cbc, |
129 | unsigned int *pos) | 129 | size_t *pos) |
130 | { | 130 | { |
131 | CURL *c; | 131 | CURL *c; |
132 | 132 | ||
@@ -156,17 +156,17 @@ setup_curl (long port, | |||
156 | } | 156 | } |
157 | 157 | ||
158 | 158 | ||
159 | static int | 159 | static unsigned int |
160 | testInternalPut (void) | 160 | testInternalPut (void) |
161 | { | 161 | { |
162 | struct MHD_Daemon *d; | 162 | struct MHD_Daemon *d; |
163 | CURL *c; | 163 | CURL *c; |
164 | char buf[2048]; | 164 | char buf[2048]; |
165 | struct CBC cbc; | 165 | struct CBC cbc; |
166 | unsigned int pos = 0; | 166 | size_t pos = 0; |
167 | int done_flag = 0; | 167 | int done_flag = 0; |
168 | CURLcode errornum; | 168 | CURLcode errornum; |
169 | int port; | 169 | uint16_t port; |
170 | 170 | ||
171 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 171 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
172 | port = 0; | 172 | port = 0; |
@@ -193,7 +193,7 @@ testInternalPut (void) | |||
193 | { | 193 | { |
194 | MHD_stop_daemon (d); return 32; | 194 | MHD_stop_daemon (d); return 32; |
195 | } | 195 | } |
196 | port = (int) dinfo->port; | 196 | port = dinfo->port; |
197 | } | 197 | } |
198 | c = setup_curl (port, &cbc, &pos); | 198 | c = setup_curl (port, &cbc, &pos); |
199 | if (CURLE_OK != (errornum = curl_easy_perform (c))) | 199 | if (CURLE_OK != (errornum = curl_easy_perform (c))) |
@@ -215,17 +215,17 @@ testInternalPut (void) | |||
215 | } | 215 | } |
216 | 216 | ||
217 | 217 | ||
218 | static int | 218 | static unsigned int |
219 | testMultithreadedPut (void) | 219 | testMultithreadedPut (void) |
220 | { | 220 | { |
221 | struct MHD_Daemon *d; | 221 | struct MHD_Daemon *d; |
222 | CURL *c; | 222 | CURL *c; |
223 | char buf[2048]; | 223 | char buf[2048]; |
224 | struct CBC cbc; | 224 | struct CBC cbc; |
225 | unsigned int pos = 0; | 225 | size_t pos = 0; |
226 | int done_flag = 0; | 226 | int done_flag = 0; |
227 | CURLcode errornum; | 227 | CURLcode errornum; |
228 | int port; | 228 | uint16_t port; |
229 | 229 | ||
230 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 230 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
231 | port = 0; | 231 | port = 0; |
@@ -253,7 +253,7 @@ testMultithreadedPut (void) | |||
253 | { | 253 | { |
254 | MHD_stop_daemon (d); return 32; | 254 | MHD_stop_daemon (d); return 32; |
255 | } | 255 | } |
256 | port = (int) dinfo->port; | 256 | port = dinfo->port; |
257 | } | 257 | } |
258 | c = setup_curl (port, &cbc, &pos); | 258 | c = setup_curl (port, &cbc, &pos); |
259 | if (CURLE_OK != (errornum = curl_easy_perform (c))) | 259 | if (CURLE_OK != (errornum = curl_easy_perform (c))) |
@@ -276,17 +276,17 @@ testMultithreadedPut (void) | |||
276 | } | 276 | } |
277 | 277 | ||
278 | 278 | ||
279 | static int | 279 | static unsigned int |
280 | testMultithreadedPoolPut (void) | 280 | testMultithreadedPoolPut (void) |
281 | { | 281 | { |
282 | struct MHD_Daemon *d; | 282 | struct MHD_Daemon *d; |
283 | CURL *c; | 283 | CURL *c; |
284 | char buf[2048]; | 284 | char buf[2048]; |
285 | struct CBC cbc; | 285 | struct CBC cbc; |
286 | unsigned int pos = 0; | 286 | size_t pos = 0; |
287 | int done_flag = 0; | 287 | int done_flag = 0; |
288 | CURLcode errornum; | 288 | CURLcode errornum; |
289 | int port; | 289 | uint16_t port; |
290 | 290 | ||
291 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 291 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
292 | port = 0; | 292 | port = 0; |
@@ -315,7 +315,7 @@ testMultithreadedPoolPut (void) | |||
315 | { | 315 | { |
316 | MHD_stop_daemon (d); return 32; | 316 | MHD_stop_daemon (d); return 32; |
317 | } | 317 | } |
318 | port = (int) dinfo->port; | 318 | port = dinfo->port; |
319 | } | 319 | } |
320 | c = setup_curl (port, &cbc, &pos); | 320 | c = setup_curl (port, &cbc, &pos); |
321 | if (CURLE_OK != (errornum = curl_easy_perform (c))) | 321 | if (CURLE_OK != (errornum = curl_easy_perform (c))) |
@@ -338,7 +338,7 @@ testMultithreadedPoolPut (void) | |||
338 | } | 338 | } |
339 | 339 | ||
340 | 340 | ||
341 | static int | 341 | static unsigned int |
342 | testExternalPut (void) | 342 | testExternalPut (void) |
343 | { | 343 | { |
344 | struct MHD_Daemon *d; | 344 | struct MHD_Daemon *d; |
@@ -356,9 +356,9 @@ testExternalPut (void) | |||
356 | struct CURLMsg *msg; | 356 | struct CURLMsg *msg; |
357 | time_t start; | 357 | time_t start; |
358 | struct timeval tv; | 358 | struct timeval tv; |
359 | unsigned int pos = 0; | 359 | size_t pos = 0; |
360 | int done_flag = 0; | 360 | int done_flag = 0; |
361 | int port; | 361 | uint16_t port; |
362 | 362 | ||
363 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 363 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
364 | port = 0; | 364 | port = 0; |
@@ -386,7 +386,7 @@ testExternalPut (void) | |||
386 | { | 386 | { |
387 | MHD_stop_daemon (d); return 32; | 387 | MHD_stop_daemon (d); return 32; |
388 | } | 388 | } |
389 | port = (int) dinfo->port; | 389 | port = dinfo->port; |
390 | } | 390 | } |
391 | c = setup_curl (port, &cbc, &pos); | 391 | c = setup_curl (port, &cbc, &pos); |
392 | 392 | ||
diff --git a/src/testcurl/test_post.c b/src/testcurl/test_post.c index f0040140..1102da5a 100644 --- a/src/testcurl/test_post.c +++ b/src/testcurl/test_post.c | |||
@@ -165,7 +165,7 @@ ahc_echo (void *cls, | |||
165 | } | 165 | } |
166 | 166 | ||
167 | 167 | ||
168 | static int | 168 | static unsigned int |
169 | testInternalPost (void) | 169 | testInternalPost (void) |
170 | { | 170 | { |
171 | struct MHD_Daemon *d; | 171 | struct MHD_Daemon *d; |
@@ -173,7 +173,7 @@ testInternalPost (void) | |||
173 | char buf[2048]; | 173 | char buf[2048]; |
174 | struct CBC cbc; | 174 | struct CBC cbc; |
175 | CURLcode errornum; | 175 | CURLcode errornum; |
176 | int port; | 176 | uint16_t port; |
177 | 177 | ||
178 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 178 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
179 | port = 0; | 179 | port = 0; |
@@ -201,7 +201,7 @@ testInternalPost (void) | |||
201 | { | 201 | { |
202 | MHD_stop_daemon (d); return 32; | 202 | MHD_stop_daemon (d); return 32; |
203 | } | 203 | } |
204 | port = (int) dinfo->port; | 204 | port = dinfo->port; |
205 | } | 205 | } |
206 | c = curl_easy_init (); | 206 | c = curl_easy_init (); |
207 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); | 207 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); |
@@ -241,7 +241,7 @@ testInternalPost (void) | |||
241 | } | 241 | } |
242 | 242 | ||
243 | 243 | ||
244 | static int | 244 | static unsigned int |
245 | testMultithreadedPost (void) | 245 | testMultithreadedPost (void) |
246 | { | 246 | { |
247 | struct MHD_Daemon *d; | 247 | struct MHD_Daemon *d; |
@@ -249,7 +249,7 @@ testMultithreadedPost (void) | |||
249 | char buf[2048]; | 249 | char buf[2048]; |
250 | struct CBC cbc; | 250 | struct CBC cbc; |
251 | CURLcode errornum; | 251 | CURLcode errornum; |
252 | int port; | 252 | uint16_t port; |
253 | 253 | ||
254 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 254 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
255 | port = 0; | 255 | port = 0; |
@@ -278,7 +278,7 @@ testMultithreadedPost (void) | |||
278 | { | 278 | { |
279 | MHD_stop_daemon (d); return 32; | 279 | MHD_stop_daemon (d); return 32; |
280 | } | 280 | } |
281 | port = (int) dinfo->port; | 281 | port = dinfo->port; |
282 | } | 282 | } |
283 | c = curl_easy_init (); | 283 | c = curl_easy_init (); |
284 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); | 284 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); |
@@ -318,7 +318,7 @@ testMultithreadedPost (void) | |||
318 | } | 318 | } |
319 | 319 | ||
320 | 320 | ||
321 | static int | 321 | static unsigned int |
322 | testMultithreadedPoolPost (void) | 322 | testMultithreadedPoolPost (void) |
323 | { | 323 | { |
324 | struct MHD_Daemon *d; | 324 | struct MHD_Daemon *d; |
@@ -326,7 +326,7 @@ testMultithreadedPoolPost (void) | |||
326 | char buf[2048]; | 326 | char buf[2048]; |
327 | struct CBC cbc; | 327 | struct CBC cbc; |
328 | CURLcode errornum; | 328 | CURLcode errornum; |
329 | int port; | 329 | uint16_t port; |
330 | 330 | ||
331 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 331 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
332 | port = 0; | 332 | port = 0; |
@@ -355,7 +355,7 @@ testMultithreadedPoolPost (void) | |||
355 | { | 355 | { |
356 | MHD_stop_daemon (d); return 32; | 356 | MHD_stop_daemon (d); return 32; |
357 | } | 357 | } |
358 | port = (int) dinfo->port; | 358 | port = dinfo->port; |
359 | } | 359 | } |
360 | c = curl_easy_init (); | 360 | c = curl_easy_init (); |
361 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); | 361 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); |
@@ -395,7 +395,7 @@ testMultithreadedPoolPost (void) | |||
395 | } | 395 | } |
396 | 396 | ||
397 | 397 | ||
398 | static int | 398 | static unsigned int |
399 | testExternalPost (void) | 399 | testExternalPost (void) |
400 | { | 400 | { |
401 | struct MHD_Daemon *d; | 401 | struct MHD_Daemon *d; |
@@ -417,7 +417,7 @@ testExternalPost (void) | |||
417 | struct CURLMsg *msg; | 417 | struct CURLMsg *msg; |
418 | time_t start; | 418 | time_t start; |
419 | struct timeval tv; | 419 | struct timeval tv; |
420 | int port; | 420 | uint16_t port; |
421 | 421 | ||
422 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 422 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
423 | port = 0; | 423 | port = 0; |
@@ -446,7 +446,7 @@ testExternalPost (void) | |||
446 | { | 446 | { |
447 | MHD_stop_daemon (d); return 32; | 447 | MHD_stop_daemon (d); return 32; |
448 | } | 448 | } |
449 | port = (int) dinfo->port; | 449 | port = dinfo->port; |
450 | } | 450 | } |
451 | c = curl_easy_init (); | 451 | c = curl_easy_init (); |
452 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); | 452 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); |
@@ -666,7 +666,7 @@ slowReadBuffer (void *p, size_t size, size_t nmemb, void *opaque) | |||
666 | #define FLAG_COUNT 16 | 666 | #define FLAG_COUNT 16 |
667 | 667 | ||
668 | 668 | ||
669 | static int | 669 | static unsigned int |
670 | testMultithreadedPostCancelPart (int flags) | 670 | testMultithreadedPostCancelPart (int flags) |
671 | { | 671 | { |
672 | struct MHD_Daemon *d; | 672 | struct MHD_Daemon *d; |
@@ -677,9 +677,9 @@ testMultithreadedPostCancelPart (int flags) | |||
677 | struct curl_slist *headers = NULL; | 677 | struct curl_slist *headers = NULL; |
678 | long response_code; | 678 | long response_code; |
679 | CURLcode cc; | 679 | CURLcode cc; |
680 | int result = 0; | 680 | unsigned int result = 0; |
681 | struct CRBC crbc; | 681 | struct CRBC crbc; |
682 | int port; | 682 | uint16_t port; |
683 | 683 | ||
684 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 684 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
685 | port = 0; | 685 | port = 0; |
@@ -712,7 +712,7 @@ testMultithreadedPostCancelPart (int flags) | |||
712 | { | 712 | { |
713 | MHD_stop_daemon (d); return 32; | 713 | MHD_stop_daemon (d); return 32; |
714 | } | 714 | } |
715 | port = (int) dinfo->port; | 715 | port = dinfo->port; |
716 | } | 716 | } |
717 | 717 | ||
718 | crbc.buffer = "Test content"; | 718 | crbc.buffer = "Test content"; |
@@ -802,10 +802,10 @@ testMultithreadedPostCancelPart (int flags) | |||
802 | } | 802 | } |
803 | 803 | ||
804 | 804 | ||
805 | static int | 805 | static unsigned int |
806 | testMultithreadedPostCancel (void) | 806 | testMultithreadedPostCancel (void) |
807 | { | 807 | { |
808 | int result = 0; | 808 | unsigned int result = 0; |
809 | int flags; | 809 | int flags; |
810 | for (flags = 0; flags < FLAG_COUNT; ++flags) | 810 | for (flags = 0; flags < FLAG_COUNT; ++flags) |
811 | result |= testMultithreadedPostCancelPart (flags); | 811 | result |= testMultithreadedPostCancelPart (flags); |
diff --git a/src/testcurl/test_post_loop.c b/src/testcurl/test_post_loop.c index efcd5370..8a7e0d05 100644 --- a/src/testcurl/test_post_loop.c +++ b/src/testcurl/test_post_loop.c | |||
@@ -117,7 +117,7 @@ ahc_echo (void *cls, | |||
117 | } | 117 | } |
118 | 118 | ||
119 | 119 | ||
120 | static int | 120 | static unsigned int |
121 | testInternalPost (void) | 121 | testInternalPost (void) |
122 | { | 122 | { |
123 | struct MHD_Daemon *d; | 123 | struct MHD_Daemon *d; |
@@ -127,7 +127,7 @@ testInternalPost (void) | |||
127 | CURLcode errornum; | 127 | CURLcode errornum; |
128 | int i; | 128 | int i; |
129 | char url[1024]; | 129 | char url[1024]; |
130 | int port; | 130 | uint16_t port; |
131 | 131 | ||
132 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 132 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
133 | port = 0; | 133 | port = 0; |
@@ -152,7 +152,7 @@ testInternalPost (void) | |||
152 | { | 152 | { |
153 | MHD_stop_daemon (d); return 32; | 153 | MHD_stop_daemon (d); return 32; |
154 | } | 154 | } |
155 | port = (int) dinfo->port; | 155 | port = dinfo->port; |
156 | } | 156 | } |
157 | for (i = 0; i < LOOPCOUNT; i++) | 157 | for (i = 0; i < LOOPCOUNT; i++) |
158 | { | 158 | { |
@@ -163,8 +163,8 @@ testInternalPost (void) | |||
163 | buf[0] = '\0'; | 163 | buf[0] = '\0'; |
164 | snprintf (url, | 164 | snprintf (url, |
165 | sizeof (url), | 165 | sizeof (url), |
166 | "http://127.0.0.1:%d/hw%d", | 166 | "http://127.0.0.1:%u/hw%d", |
167 | port, | 167 | (unsigned int) port, |
168 | i); | 168 | i); |
169 | curl_easy_setopt (c, CURLOPT_URL, url); | 169 | curl_easy_setopt (c, CURLOPT_URL, url); |
170 | curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, ©Buffer); | 170 | curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, ©Buffer); |
@@ -206,7 +206,7 @@ testInternalPost (void) | |||
206 | } | 206 | } |
207 | 207 | ||
208 | 208 | ||
209 | static int | 209 | static unsigned int |
210 | testMultithreadedPost (void) | 210 | testMultithreadedPost (void) |
211 | { | 211 | { |
212 | struct MHD_Daemon *d; | 212 | struct MHD_Daemon *d; |
@@ -216,7 +216,7 @@ testMultithreadedPost (void) | |||
216 | CURLcode errornum; | 216 | CURLcode errornum; |
217 | int i; | 217 | int i; |
218 | char url[1024]; | 218 | char url[1024]; |
219 | int port; | 219 | uint16_t port; |
220 | 220 | ||
221 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 221 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
222 | port = 0; | 222 | port = 0; |
@@ -244,7 +244,7 @@ testMultithreadedPost (void) | |||
244 | { | 244 | { |
245 | MHD_stop_daemon (d); return 32; | 245 | MHD_stop_daemon (d); return 32; |
246 | } | 246 | } |
247 | port = (int) dinfo->port; | 247 | port = dinfo->port; |
248 | } | 248 | } |
249 | for (i = 0; i < LOOPCOUNT; i++) | 249 | for (i = 0; i < LOOPCOUNT; i++) |
250 | { | 250 | { |
@@ -255,8 +255,8 @@ testMultithreadedPost (void) | |||
255 | buf[0] = '\0'; | 255 | buf[0] = '\0'; |
256 | snprintf (url, | 256 | snprintf (url, |
257 | sizeof (url), | 257 | sizeof (url), |
258 | "http://127.0.0.1:%d/hw%d", | 258 | "http://127.0.0.1:%u/hw%d", |
259 | port, | 259 | (unsigned int) port, |
260 | i); | 260 | i); |
261 | curl_easy_setopt (c, CURLOPT_URL, url); | 261 | curl_easy_setopt (c, CURLOPT_URL, url); |
262 | curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, ©Buffer); | 262 | curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, ©Buffer); |
@@ -298,7 +298,7 @@ testMultithreadedPost (void) | |||
298 | } | 298 | } |
299 | 299 | ||
300 | 300 | ||
301 | static int | 301 | static unsigned int |
302 | testMultithreadedPoolPost (void) | 302 | testMultithreadedPoolPost (void) |
303 | { | 303 | { |
304 | struct MHD_Daemon *d; | 304 | struct MHD_Daemon *d; |
@@ -308,7 +308,7 @@ testMultithreadedPoolPost (void) | |||
308 | CURLcode errornum; | 308 | CURLcode errornum; |
309 | int i; | 309 | int i; |
310 | char url[1024]; | 310 | char url[1024]; |
311 | int port; | 311 | uint16_t port; |
312 | 312 | ||
313 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 313 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
314 | port = 0; | 314 | port = 0; |
@@ -335,7 +335,7 @@ testMultithreadedPoolPost (void) | |||
335 | { | 335 | { |
336 | MHD_stop_daemon (d); return 32; | 336 | MHD_stop_daemon (d); return 32; |
337 | } | 337 | } |
338 | port = (int) dinfo->port; | 338 | port = dinfo->port; |
339 | } | 339 | } |
340 | for (i = 0; i < LOOPCOUNT; i++) | 340 | for (i = 0; i < LOOPCOUNT; i++) |
341 | { | 341 | { |
@@ -346,8 +346,8 @@ testMultithreadedPoolPost (void) | |||
346 | buf[0] = '\0'; | 346 | buf[0] = '\0'; |
347 | snprintf (url, | 347 | snprintf (url, |
348 | sizeof (url), | 348 | sizeof (url), |
349 | "http://127.0.0.1:%d/hw%d", | 349 | "http://127.0.0.1:%u/hw%d", |
350 | port, | 350 | (unsigned int) port, |
351 | i); | 351 | i); |
352 | curl_easy_setopt (c, CURLOPT_URL, url); | 352 | curl_easy_setopt (c, CURLOPT_URL, url); |
353 | curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, ©Buffer); | 353 | curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, ©Buffer); |
@@ -389,7 +389,7 @@ testMultithreadedPoolPost (void) | |||
389 | } | 389 | } |
390 | 390 | ||
391 | 391 | ||
392 | static int | 392 | static unsigned int |
393 | testExternalPost (void) | 393 | testExternalPost (void) |
394 | { | 394 | { |
395 | struct MHD_Daemon *d; | 395 | struct MHD_Daemon *d; |
@@ -415,7 +415,7 @@ testExternalPost (void) | |||
415 | uint64_t timeout64; | 415 | uint64_t timeout64; |
416 | long ctimeout; | 416 | long ctimeout; |
417 | char url[1024]; | 417 | char url[1024]; |
418 | int port; | 418 | uint16_t port; |
419 | 419 | ||
420 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 420 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
421 | port = 0; | 421 | port = 0; |
@@ -442,7 +442,7 @@ testExternalPost (void) | |||
442 | { | 442 | { |
443 | MHD_stop_daemon (d); return 32; | 443 | MHD_stop_daemon (d); return 32; |
444 | } | 444 | } |
445 | port = (int) dinfo->port; | 445 | port = dinfo->port; |
446 | } | 446 | } |
447 | multi = curl_multi_init (); | 447 | multi = curl_multi_init (); |
448 | if (multi == NULL) | 448 | if (multi == NULL) |
@@ -459,8 +459,8 @@ testExternalPost (void) | |||
459 | buf[0] = '\0'; | 459 | buf[0] = '\0'; |
460 | snprintf (url, | 460 | snprintf (url, |
461 | sizeof (url), | 461 | sizeof (url), |
462 | "http://127.0.0.1:%d/hw%d", | 462 | "http://127.0.0.1:%u/hw%d", |
463 | port, | 463 | (unsigned int) port, |
464 | i); | 464 | i); |
465 | curl_easy_setopt (c, CURLOPT_URL, url); | 465 | curl_easy_setopt (c, CURLOPT_URL, url); |
466 | curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, ©Buffer); | 466 | curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, ©Buffer); |
@@ -644,21 +644,24 @@ main (int argc, char *const *argv) | |||
644 | oneone ? "%s: Sequential POSTs (http/1.1) %f/s\n" : | 644 | oneone ? "%s: Sequential POSTs (http/1.1) %f/s\n" : |
645 | "%s: Sequential POSTs (http/1.0) %f/s\n", | 645 | "%s: Sequential POSTs (http/1.0) %f/s\n", |
646 | "internal select", | 646 | "internal select", |
647 | (double) 1000 * LOOPCOUNT / (now () - start_time + 1.0)); | 647 | (double) 1000 * LOOPCOUNT |
648 | / ((double) (now () - start_time) + 1.0)); | ||
648 | start_time = now (); | 649 | start_time = now (); |
649 | errorCount += testMultithreadedPost (); | 650 | errorCount += testMultithreadedPost (); |
650 | fprintf (stderr, | 651 | fprintf (stderr, |
651 | oneone ? "%s: Sequential POSTs (http/1.1) %f/s\n" : | 652 | oneone ? "%s: Sequential POSTs (http/1.1) %f/s\n" : |
652 | "%s: Sequential POSTs (http/1.0) %f/s\n", | 653 | "%s: Sequential POSTs (http/1.0) %f/s\n", |
653 | "multithreaded post", | 654 | "multithreaded post", |
654 | (double) 1000 * LOOPCOUNT / (now () - start_time + 1.0)); | 655 | (double) 1000 * LOOPCOUNT |
656 | / ((double) (now () - start_time) + 1.0)); | ||
655 | start_time = now (); | 657 | start_time = now (); |
656 | errorCount += testMultithreadedPoolPost (); | 658 | errorCount += testMultithreadedPoolPost (); |
657 | fprintf (stderr, | 659 | fprintf (stderr, |
658 | oneone ? "%s: Sequential POSTs (http/1.1) %f/s\n" : | 660 | oneone ? "%s: Sequential POSTs (http/1.1) %f/s\n" : |
659 | "%s: Sequential POSTs (http/1.0) %f/s\n", | 661 | "%s: Sequential POSTs (http/1.0) %f/s\n", |
660 | "thread with pool", | 662 | "thread with pool", |
661 | (double) 1000 * LOOPCOUNT / (now () - start_time + 1.0)); | 663 | (double) 1000 * LOOPCOUNT |
664 | / ((double) (now () - start_time) + 1.0)); | ||
662 | } | 665 | } |
663 | start_time = now (); | 666 | start_time = now (); |
664 | errorCount += testExternalPost (); | 667 | errorCount += testExternalPost (); |
@@ -666,7 +669,8 @@ main (int argc, char *const *argv) | |||
666 | oneone ? "%s: Sequential POSTs (http/1.1) %f/s\n" : | 669 | oneone ? "%s: Sequential POSTs (http/1.1) %f/s\n" : |
667 | "%s: Sequential POSTs (http/1.0) %f/s\n", | 670 | "%s: Sequential POSTs (http/1.0) %f/s\n", |
668 | "external select", | 671 | "external select", |
669 | (double) 1000 * LOOPCOUNT / (now () - start_time + 1.0)); | 672 | (double) 1000 * LOOPCOUNT |
673 | / ((double) (now () - start_time) + 1.0)); | ||
670 | if (errorCount != 0) | 674 | if (errorCount != 0) |
671 | fprintf (stderr, "Error (code: %u)\n", errorCount); | 675 | fprintf (stderr, "Error (code: %u)\n", errorCount); |
672 | curl_global_cleanup (); | 676 | curl_global_cleanup (); |
diff --git a/src/testcurl/test_postform.c b/src/testcurl/test_postform.c index 4fb4fe4f..e46250af 100644 --- a/src/testcurl/test_postform.c +++ b/src/testcurl/test_postform.c | |||
@@ -187,7 +187,7 @@ make_form (void) | |||
187 | } | 187 | } |
188 | 188 | ||
189 | 189 | ||
190 | static int | 190 | static unsigned int |
191 | testInternalPost (void) | 191 | testInternalPost (void) |
192 | { | 192 | { |
193 | struct MHD_Daemon *d; | 193 | struct MHD_Daemon *d; |
@@ -196,7 +196,7 @@ testInternalPost (void) | |||
196 | struct CBC cbc; | 196 | struct CBC cbc; |
197 | CURLcode errornum; | 197 | CURLcode errornum; |
198 | struct curl_httppost *pd; | 198 | struct curl_httppost *pd; |
199 | int port; | 199 | uint16_t port; |
200 | 200 | ||
201 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 201 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
202 | port = 0; | 202 | port = 0; |
@@ -224,7 +224,7 @@ testInternalPost (void) | |||
224 | { | 224 | { |
225 | MHD_stop_daemon (d); return 32; | 225 | MHD_stop_daemon (d); return 32; |
226 | } | 226 | } |
227 | port = (int) dinfo->port; | 227 | port = dinfo->port; |
228 | } | 228 | } |
229 | c = curl_easy_init (); | 229 | c = curl_easy_init (); |
230 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); | 230 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); |
@@ -265,7 +265,7 @@ testInternalPost (void) | |||
265 | } | 265 | } |
266 | 266 | ||
267 | 267 | ||
268 | static int | 268 | static unsigned int |
269 | testMultithreadedPost (void) | 269 | testMultithreadedPost (void) |
270 | { | 270 | { |
271 | struct MHD_Daemon *d; | 271 | struct MHD_Daemon *d; |
@@ -274,7 +274,7 @@ testMultithreadedPost (void) | |||
274 | struct CBC cbc; | 274 | struct CBC cbc; |
275 | CURLcode errornum; | 275 | CURLcode errornum; |
276 | struct curl_httppost *pd; | 276 | struct curl_httppost *pd; |
277 | int port; | 277 | uint16_t port; |
278 | 278 | ||
279 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 279 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
280 | port = 0; | 280 | port = 0; |
@@ -303,7 +303,7 @@ testMultithreadedPost (void) | |||
303 | { | 303 | { |
304 | MHD_stop_daemon (d); return 32; | 304 | MHD_stop_daemon (d); return 32; |
305 | } | 305 | } |
306 | port = (int) dinfo->port; | 306 | port = dinfo->port; |
307 | } | 307 | } |
308 | c = curl_easy_init (); | 308 | c = curl_easy_init (); |
309 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); | 309 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); |
@@ -344,7 +344,7 @@ testMultithreadedPost (void) | |||
344 | } | 344 | } |
345 | 345 | ||
346 | 346 | ||
347 | static int | 347 | static unsigned int |
348 | testMultithreadedPoolPost (void) | 348 | testMultithreadedPoolPost (void) |
349 | { | 349 | { |
350 | struct MHD_Daemon *d; | 350 | struct MHD_Daemon *d; |
@@ -353,7 +353,7 @@ testMultithreadedPoolPost (void) | |||
353 | struct CBC cbc; | 353 | struct CBC cbc; |
354 | CURLcode errornum; | 354 | CURLcode errornum; |
355 | struct curl_httppost *pd; | 355 | struct curl_httppost *pd; |
356 | int port; | 356 | uint16_t port; |
357 | 357 | ||
358 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 358 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
359 | port = 0; | 359 | port = 0; |
@@ -382,7 +382,7 @@ testMultithreadedPoolPost (void) | |||
382 | { | 382 | { |
383 | MHD_stop_daemon (d); return 32; | 383 | MHD_stop_daemon (d); return 32; |
384 | } | 384 | } |
385 | port = (int) dinfo->port; | 385 | port = dinfo->port; |
386 | } | 386 | } |
387 | c = curl_easy_init (); | 387 | c = curl_easy_init (); |
388 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); | 388 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); |
@@ -423,7 +423,7 @@ testMultithreadedPoolPost (void) | |||
423 | } | 423 | } |
424 | 424 | ||
425 | 425 | ||
426 | static int | 426 | static unsigned int |
427 | testExternalPost (void) | 427 | testExternalPost (void) |
428 | { | 428 | { |
429 | struct MHD_Daemon *d; | 429 | struct MHD_Daemon *d; |
@@ -446,7 +446,7 @@ testExternalPost (void) | |||
446 | time_t start; | 446 | time_t start; |
447 | struct timeval tv; | 447 | struct timeval tv; |
448 | struct curl_httppost *pd; | 448 | struct curl_httppost *pd; |
449 | int port; | 449 | uint16_t port; |
450 | 450 | ||
451 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 451 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
452 | port = 0; | 452 | port = 0; |
@@ -475,7 +475,7 @@ testExternalPost (void) | |||
475 | { | 475 | { |
476 | MHD_stop_daemon (d); return 32; | 476 | MHD_stop_daemon (d); return 32; |
477 | } | 477 | } |
478 | port = (int) dinfo->port; | 478 | port = dinfo->port; |
479 | } | 479 | } |
480 | c = curl_easy_init (); | 480 | c = curl_easy_init (); |
481 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); | 481 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); |
diff --git a/src/testcurl/test_process_arguments.c b/src/testcurl/test_process_arguments.c index 14c00aab..9aa713dc 100644 --- a/src/testcurl/test_process_arguments.c +++ b/src/testcurl/test_process_arguments.c | |||
@@ -111,7 +111,7 @@ ahc_echo (void *cls, | |||
111 | } | 111 | } |
112 | 112 | ||
113 | 113 | ||
114 | static int | 114 | static unsigned int |
115 | testExternalGet (void) | 115 | testExternalGet (void) |
116 | { | 116 | { |
117 | struct MHD_Daemon *d; | 117 | struct MHD_Daemon *d; |
@@ -133,7 +133,7 @@ testExternalGet (void) | |||
133 | struct CURLMsg *msg; | 133 | struct CURLMsg *msg; |
134 | time_t start; | 134 | time_t start; |
135 | struct timeval tv; | 135 | struct timeval tv; |
136 | int port; | 136 | uint16_t port; |
137 | 137 | ||
138 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 138 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
139 | port = 0; | 139 | port = 0; |
@@ -160,7 +160,7 @@ testExternalGet (void) | |||
160 | { | 160 | { |
161 | MHD_stop_daemon (d); return 32; | 161 | MHD_stop_daemon (d); return 32; |
162 | } | 162 | } |
163 | port = (int) dinfo->port; | 163 | port = dinfo->port; |
164 | } | 164 | } |
165 | c = curl_easy_init (); | 165 | c = curl_easy_init (); |
166 | curl_easy_setopt (c, CURLOPT_URL, | 166 | curl_easy_setopt (c, CURLOPT_URL, |
diff --git a/src/testcurl/test_process_headers.c b/src/testcurl/test_process_headers.c index 603b1fb6..721e3073 100644 --- a/src/testcurl/test_process_headers.c +++ b/src/testcurl/test_process_headers.c | |||
@@ -152,7 +152,7 @@ ahc_echo (void *cls, | |||
152 | } | 152 | } |
153 | 153 | ||
154 | 154 | ||
155 | static int | 155 | static unsigned int |
156 | testInternalGet (void) | 156 | testInternalGet (void) |
157 | { | 157 | { |
158 | struct MHD_Daemon *d; | 158 | struct MHD_Daemon *d; |
@@ -160,7 +160,7 @@ testInternalGet (void) | |||
160 | char buf[2048]; | 160 | char buf[2048]; |
161 | struct CBC cbc; | 161 | struct CBC cbc; |
162 | CURLcode errornum; | 162 | CURLcode errornum; |
163 | int port; | 163 | uint16_t port; |
164 | 164 | ||
165 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 165 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
166 | port = 0; | 166 | port = 0; |
@@ -186,7 +186,7 @@ testInternalGet (void) | |||
186 | { | 186 | { |
187 | MHD_stop_daemon (d); return 32; | 187 | MHD_stop_daemon (d); return 32; |
188 | } | 188 | } |
189 | port = (int) dinfo->port; | 189 | port = dinfo->port; |
190 | } | 190 | } |
191 | c = curl_easy_init (); | 191 | c = curl_easy_init (); |
192 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); | 192 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); |
@@ -223,7 +223,7 @@ testInternalGet (void) | |||
223 | } | 223 | } |
224 | 224 | ||
225 | 225 | ||
226 | static int | 226 | static unsigned int |
227 | testMultithreadedGet (void) | 227 | testMultithreadedGet (void) |
228 | { | 228 | { |
229 | struct MHD_Daemon *d; | 229 | struct MHD_Daemon *d; |
@@ -231,7 +231,7 @@ testMultithreadedGet (void) | |||
231 | char buf[2048]; | 231 | char buf[2048]; |
232 | struct CBC cbc; | 232 | struct CBC cbc; |
233 | CURLcode errornum; | 233 | CURLcode errornum; |
234 | int port; | 234 | uint16_t port; |
235 | 235 | ||
236 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 236 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
237 | port = 0; | 237 | port = 0; |
@@ -258,7 +258,7 @@ testMultithreadedGet (void) | |||
258 | { | 258 | { |
259 | MHD_stop_daemon (d); return 32; | 259 | MHD_stop_daemon (d); return 32; |
260 | } | 260 | } |
261 | port = (int) dinfo->port; | 261 | port = dinfo->port; |
262 | } | 262 | } |
263 | c = curl_easy_init (); | 263 | c = curl_easy_init (); |
264 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); | 264 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); |
@@ -295,7 +295,7 @@ testMultithreadedGet (void) | |||
295 | } | 295 | } |
296 | 296 | ||
297 | 297 | ||
298 | static int | 298 | static unsigned int |
299 | testMultithreadedPoolGet (void) | 299 | testMultithreadedPoolGet (void) |
300 | { | 300 | { |
301 | struct MHD_Daemon *d; | 301 | struct MHD_Daemon *d; |
@@ -303,7 +303,7 @@ testMultithreadedPoolGet (void) | |||
303 | char buf[2048]; | 303 | char buf[2048]; |
304 | struct CBC cbc; | 304 | struct CBC cbc; |
305 | CURLcode errornum; | 305 | CURLcode errornum; |
306 | int port; | 306 | uint16_t port; |
307 | 307 | ||
308 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 308 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
309 | port = 0; | 309 | port = 0; |
@@ -331,7 +331,7 @@ testMultithreadedPoolGet (void) | |||
331 | { | 331 | { |
332 | MHD_stop_daemon (d); return 32; | 332 | MHD_stop_daemon (d); return 32; |
333 | } | 333 | } |
334 | port = (int) dinfo->port; | 334 | port = dinfo->port; |
335 | } | 335 | } |
336 | c = curl_easy_init (); | 336 | c = curl_easy_init (); |
337 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); | 337 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); |
@@ -368,7 +368,7 @@ testMultithreadedPoolGet (void) | |||
368 | } | 368 | } |
369 | 369 | ||
370 | 370 | ||
371 | static int | 371 | static unsigned int |
372 | testExternalGet (void) | 372 | testExternalGet (void) |
373 | { | 373 | { |
374 | struct MHD_Daemon *d; | 374 | struct MHD_Daemon *d; |
@@ -390,7 +390,7 @@ testExternalGet (void) | |||
390 | struct CURLMsg *msg; | 390 | struct CURLMsg *msg; |
391 | time_t start; | 391 | time_t start; |
392 | struct timeval tv; | 392 | struct timeval tv; |
393 | int port; | 393 | uint16_t port; |
394 | 394 | ||
395 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 395 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
396 | port = 0; | 396 | port = 0; |
@@ -417,7 +417,7 @@ testExternalGet (void) | |||
417 | { | 417 | { |
418 | MHD_stop_daemon (d); return 32; | 418 | MHD_stop_daemon (d); return 32; |
419 | } | 419 | } |
420 | port = (int) dinfo->port; | 420 | port = dinfo->port; |
421 | } | 421 | } |
422 | c = curl_easy_init (); | 422 | c = curl_easy_init (); |
423 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); | 423 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); |
diff --git a/src/testcurl/test_put.c b/src/testcurl/test_put.c index 67318934..bc16ef52 100644 --- a/src/testcurl/test_put.c +++ b/src/testcurl/test_put.c | |||
@@ -58,8 +58,8 @@ struct CBC | |||
58 | static size_t | 58 | static size_t |
59 | putBuffer (void *stream, size_t size, size_t nmemb, void *ptr) | 59 | putBuffer (void *stream, size_t size, size_t nmemb, void *ptr) |
60 | { | 60 | { |
61 | unsigned int *pos = ptr; | 61 | size_t *pos = ptr; |
62 | unsigned int wrt; | 62 | size_t wrt; |
63 | 63 | ||
64 | wrt = size * nmemb; | 64 | wrt = size * nmemb; |
65 | if (wrt > 8 - (*pos)) | 65 | if (wrt > 8 - (*pos)) |
@@ -123,17 +123,17 @@ ahc_echo (void *cls, | |||
123 | } | 123 | } |
124 | 124 | ||
125 | 125 | ||
126 | static int | 126 | static unsigned int |
127 | testInternalPut (void) | 127 | testInternalPut (void) |
128 | { | 128 | { |
129 | struct MHD_Daemon *d; | 129 | struct MHD_Daemon *d; |
130 | CURL *c; | 130 | CURL *c; |
131 | char buf[2048]; | 131 | char buf[2048]; |
132 | struct CBC cbc; | 132 | struct CBC cbc; |
133 | unsigned int pos = 0; | 133 | size_t pos = 0; |
134 | int done_flag = 0; | 134 | int done_flag = 0; |
135 | CURLcode errornum; | 135 | CURLcode errornum; |
136 | int port; | 136 | uint16_t port; |
137 | 137 | ||
138 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 138 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
139 | port = 0; | 139 | port = 0; |
@@ -160,7 +160,7 @@ testInternalPut (void) | |||
160 | { | 160 | { |
161 | MHD_stop_daemon (d); return 32; | 161 | MHD_stop_daemon (d); return 32; |
162 | } | 162 | } |
163 | port = (int) dinfo->port; | 163 | port = dinfo->port; |
164 | } | 164 | } |
165 | c = curl_easy_init (); | 165 | c = curl_easy_init (); |
166 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); | 166 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); |
@@ -201,17 +201,17 @@ testInternalPut (void) | |||
201 | } | 201 | } |
202 | 202 | ||
203 | 203 | ||
204 | static int | 204 | static unsigned int |
205 | testMultithreadedPut (void) | 205 | testMultithreadedPut (void) |
206 | { | 206 | { |
207 | struct MHD_Daemon *d; | 207 | struct MHD_Daemon *d; |
208 | CURL *c; | 208 | CURL *c; |
209 | char buf[2048]; | 209 | char buf[2048]; |
210 | struct CBC cbc; | 210 | struct CBC cbc; |
211 | unsigned int pos = 0; | 211 | size_t pos = 0; |
212 | int done_flag = 0; | 212 | int done_flag = 0; |
213 | CURLcode errornum; | 213 | CURLcode errornum; |
214 | int port; | 214 | uint16_t port; |
215 | 215 | ||
216 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 216 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
217 | port = 0; | 217 | port = 0; |
@@ -239,7 +239,7 @@ testMultithreadedPut (void) | |||
239 | { | 239 | { |
240 | MHD_stop_daemon (d); return 32; | 240 | MHD_stop_daemon (d); return 32; |
241 | } | 241 | } |
242 | port = (int) dinfo->port; | 242 | port = dinfo->port; |
243 | } | 243 | } |
244 | c = curl_easy_init (); | 244 | c = curl_easy_init (); |
245 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); | 245 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); |
@@ -281,17 +281,17 @@ testMultithreadedPut (void) | |||
281 | } | 281 | } |
282 | 282 | ||
283 | 283 | ||
284 | static int | 284 | static unsigned int |
285 | testMultithreadedPoolPut (void) | 285 | testMultithreadedPoolPut (void) |
286 | { | 286 | { |
287 | struct MHD_Daemon *d; | 287 | struct MHD_Daemon *d; |
288 | CURL *c; | 288 | CURL *c; |
289 | char buf[2048]; | 289 | char buf[2048]; |
290 | struct CBC cbc; | 290 | struct CBC cbc; |
291 | unsigned int pos = 0; | 291 | size_t pos = 0; |
292 | int done_flag = 0; | 292 | int done_flag = 0; |
293 | CURLcode errornum; | 293 | CURLcode errornum; |
294 | int port; | 294 | uint16_t port; |
295 | 295 | ||
296 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 296 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
297 | port = 0; | 297 | port = 0; |
@@ -320,7 +320,7 @@ testMultithreadedPoolPut (void) | |||
320 | { | 320 | { |
321 | MHD_stop_daemon (d); return 32; | 321 | MHD_stop_daemon (d); return 32; |
322 | } | 322 | } |
323 | port = (int) dinfo->port; | 323 | port = dinfo->port; |
324 | } | 324 | } |
325 | c = curl_easy_init (); | 325 | c = curl_easy_init (); |
326 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); | 326 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); |
@@ -362,7 +362,7 @@ testMultithreadedPoolPut (void) | |||
362 | } | 362 | } |
363 | 363 | ||
364 | 364 | ||
365 | static int | 365 | static unsigned int |
366 | testExternalPut (void) | 366 | testExternalPut (void) |
367 | { | 367 | { |
368 | struct MHD_Daemon *d; | 368 | struct MHD_Daemon *d; |
@@ -380,9 +380,9 @@ testExternalPut (void) | |||
380 | struct CURLMsg *msg; | 380 | struct CURLMsg *msg; |
381 | time_t start; | 381 | time_t start; |
382 | struct timeval tv; | 382 | struct timeval tv; |
383 | unsigned int pos = 0; | 383 | size_t pos = 0; |
384 | int done_flag = 0; | 384 | int done_flag = 0; |
385 | int port; | 385 | uint16_t port; |
386 | 386 | ||
387 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 387 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
388 | port = 0; | 388 | port = 0; |
@@ -410,7 +410,7 @@ testExternalPut (void) | |||
410 | { | 410 | { |
411 | MHD_stop_daemon (d); return 32; | 411 | MHD_stop_daemon (d); return 32; |
412 | } | 412 | } |
413 | port = (int) dinfo->port; | 413 | port = dinfo->port; |
414 | } | 414 | } |
415 | c = curl_easy_init (); | 415 | c = curl_easy_init (); |
416 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); | 416 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); |
diff --git a/src/testcurl/test_put_chunked.c b/src/testcurl/test_put_chunked.c index 7779b315..3ec998d8 100644 --- a/src/testcurl/test_put_chunked.c +++ b/src/testcurl/test_put_chunked.c | |||
@@ -56,8 +56,8 @@ struct CBC | |||
56 | static size_t | 56 | static size_t |
57 | putBuffer (void *stream, size_t size, size_t nmemb, void *ptr) | 57 | putBuffer (void *stream, size_t size, size_t nmemb, void *ptr) |
58 | { | 58 | { |
59 | unsigned int *pos = ptr; | 59 | size_t *pos = ptr; |
60 | unsigned int wrt; | 60 | size_t wrt; |
61 | 61 | ||
62 | wrt = size * nmemb; | 62 | wrt = size * nmemb; |
63 | if (wrt > 8 - (*pos)) | 63 | if (wrt > 8 - (*pos)) |
@@ -92,10 +92,10 @@ ahc_echo (void *cls, | |||
92 | const char *upload_data, size_t *upload_data_size, | 92 | const char *upload_data, size_t *upload_data_size, |
93 | void **req_cls) | 93 | void **req_cls) |
94 | { | 94 | { |
95 | int *done = cls; | 95 | size_t *done = cls; |
96 | struct MHD_Response *response; | 96 | struct MHD_Response *response; |
97 | enum MHD_Result ret; | 97 | enum MHD_Result ret; |
98 | int have; | 98 | size_t have; |
99 | (void) version; (void) req_cls; /* Unused. Silent compiler warning. */ | 99 | (void) version; (void) req_cls; /* Unused. Silent compiler warning. */ |
100 | 100 | ||
101 | if (0 != strcmp ("PUT", method)) | 101 | if (0 != strcmp ("PUT", method)) |
@@ -133,17 +133,17 @@ ahc_echo (void *cls, | |||
133 | } | 133 | } |
134 | 134 | ||
135 | 135 | ||
136 | static int | 136 | static unsigned int |
137 | testInternalPut (void) | 137 | testInternalPut (void) |
138 | { | 138 | { |
139 | struct MHD_Daemon *d; | 139 | struct MHD_Daemon *d; |
140 | CURL *c; | 140 | CURL *c; |
141 | char buf[2048]; | 141 | char buf[2048]; |
142 | struct CBC cbc; | 142 | struct CBC cbc; |
143 | unsigned int pos = 0; | 143 | size_t pos = 0; |
144 | int done_flag = 0; | 144 | size_t done_flag = 0; |
145 | CURLcode errornum; | 145 | CURLcode errornum; |
146 | int port; | 146 | uint16_t port; |
147 | 147 | ||
148 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 148 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
149 | port = 0; | 149 | port = 0; |
@@ -166,7 +166,7 @@ testInternalPut (void) | |||
166 | { | 166 | { |
167 | MHD_stop_daemon (d); return 32; | 167 | MHD_stop_daemon (d); return 32; |
168 | } | 168 | } |
169 | port = (int) dinfo->port; | 169 | port = dinfo->port; |
170 | } | 170 | } |
171 | c = curl_easy_init (); | 171 | c = curl_easy_init (); |
172 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); | 172 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); |
@@ -207,17 +207,17 @@ testInternalPut (void) | |||
207 | } | 207 | } |
208 | 208 | ||
209 | 209 | ||
210 | static int | 210 | static unsigned int |
211 | testMultithreadedPut (void) | 211 | testMultithreadedPut (void) |
212 | { | 212 | { |
213 | struct MHD_Daemon *d; | 213 | struct MHD_Daemon *d; |
214 | CURL *c; | 214 | CURL *c; |
215 | char buf[2048]; | 215 | char buf[2048]; |
216 | struct CBC cbc; | 216 | struct CBC cbc; |
217 | unsigned int pos = 0; | 217 | size_t pos = 0; |
218 | int done_flag = 0; | 218 | size_t done_flag = 0; |
219 | CURLcode errornum; | 219 | CURLcode errornum; |
220 | int port; | 220 | uint16_t port; |
221 | 221 | ||
222 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 222 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
223 | port = 0; | 223 | port = 0; |
@@ -241,7 +241,7 @@ testMultithreadedPut (void) | |||
241 | { | 241 | { |
242 | MHD_stop_daemon (d); return 32; | 242 | MHD_stop_daemon (d); return 32; |
243 | } | 243 | } |
244 | port = (int) dinfo->port; | 244 | port = dinfo->port; |
245 | } | 245 | } |
246 | c = curl_easy_init (); | 246 | c = curl_easy_init (); |
247 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); | 247 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); |
@@ -283,17 +283,17 @@ testMultithreadedPut (void) | |||
283 | } | 283 | } |
284 | 284 | ||
285 | 285 | ||
286 | static int | 286 | static unsigned int |
287 | testMultithreadedPoolPut (void) | 287 | testMultithreadedPoolPut (void) |
288 | { | 288 | { |
289 | struct MHD_Daemon *d; | 289 | struct MHD_Daemon *d; |
290 | CURL *c; | 290 | CURL *c; |
291 | char buf[2048]; | 291 | char buf[2048]; |
292 | struct CBC cbc; | 292 | struct CBC cbc; |
293 | unsigned int pos = 0; | 293 | size_t pos = 0; |
294 | int done_flag = 0; | 294 | size_t done_flag = 0; |
295 | CURLcode errornum; | 295 | CURLcode errornum; |
296 | int port; | 296 | uint16_t port; |
297 | 297 | ||
298 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 298 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
299 | port = 0; | 299 | port = 0; |
@@ -318,7 +318,7 @@ testMultithreadedPoolPut (void) | |||
318 | { | 318 | { |
319 | MHD_stop_daemon (d); return 32; | 319 | MHD_stop_daemon (d); return 32; |
320 | } | 320 | } |
321 | port = (int) dinfo->port; | 321 | port = dinfo->port; |
322 | } | 322 | } |
323 | c = curl_easy_init (); | 323 | c = curl_easy_init (); |
324 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); | 324 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); |
@@ -360,7 +360,7 @@ testMultithreadedPoolPut (void) | |||
360 | } | 360 | } |
361 | 361 | ||
362 | 362 | ||
363 | static int | 363 | static unsigned int |
364 | testExternalPut (void) | 364 | testExternalPut (void) |
365 | { | 365 | { |
366 | struct MHD_Daemon *d; | 366 | struct MHD_Daemon *d; |
@@ -382,9 +382,9 @@ testExternalPut (void) | |||
382 | struct CURLMsg *msg; | 382 | struct CURLMsg *msg; |
383 | time_t start; | 383 | time_t start; |
384 | struct timeval tv; | 384 | struct timeval tv; |
385 | unsigned int pos = 0; | 385 | size_t pos = 0; |
386 | int done_flag = 0; | 386 | size_t done_flag = 0; |
387 | int port; | 387 | uint16_t port; |
388 | 388 | ||
389 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 389 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
390 | port = 0; | 390 | port = 0; |
@@ -408,7 +408,7 @@ testExternalPut (void) | |||
408 | { | 408 | { |
409 | MHD_stop_daemon (d); return 32; | 409 | MHD_stop_daemon (d); return 32; |
410 | } | 410 | } |
411 | port = (int) dinfo->port; | 411 | port = dinfo->port; |
412 | } | 412 | } |
413 | c = curl_easy_init (); | 413 | c = curl_easy_init (); |
414 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); | 414 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); |
diff --git a/src/testcurl/test_quiesce.c b/src/testcurl/test_quiesce.c index 7425f839..6bd6967f 100644 --- a/src/testcurl/test_quiesce.c +++ b/src/testcurl/test_quiesce.c | |||
@@ -219,7 +219,7 @@ _checkCURLE_OK_func (CURLcode code, const char *curlFunc, | |||
219 | /* Global parameters */ | 219 | /* Global parameters */ |
220 | static int verbose; /**< Be verbose */ | 220 | static int verbose; /**< Be verbose */ |
221 | static int oneone; /**< If false use HTTP/1.0 for requests*/ | 221 | static int oneone; /**< If false use HTTP/1.0 for requests*/ |
222 | static int global_port; /**< MHD daemons listen port number */ | 222 | static uint16_t global_port; /**< MHD daemons listen port number */ |
223 | 223 | ||
224 | struct CBC | 224 | struct CBC |
225 | { | 225 | { |
@@ -394,8 +394,8 @@ setupCURL (void *cbc) | |||
394 | } | 394 | } |
395 | 395 | ||
396 | 396 | ||
397 | static int | 397 | static unsigned int |
398 | testGet (int type, int pool_count, int poll_flag) | 398 | testGet (unsigned int type, int pool_count, uint32_t poll_flag) |
399 | { | 399 | { |
400 | struct MHD_Daemon *d; | 400 | struct MHD_Daemon *d; |
401 | CURL *c; | 401 | CURL *c; |
@@ -406,15 +406,16 @@ testGet (int type, int pool_count, int poll_flag) | |||
406 | char *thrdRet; | 406 | char *thrdRet; |
407 | 407 | ||
408 | if (verbose) | 408 | if (verbose) |
409 | printf ("testGet(%d, %d, %d) test started.\n", | 409 | printf ("testGet(%u, %d, %u) test started.\n", |
410 | type, pool_count, poll_flag); | 410 | type, pool_count, (unsigned int) poll_flag); |
411 | 411 | ||
412 | cbc.buf = buf; | 412 | cbc.buf = buf; |
413 | cbc.size = sizeof(buf); | 413 | cbc.size = sizeof(buf); |
414 | cbc.pos = 0; | 414 | cbc.pos = 0; |
415 | if (pool_count > 0) | 415 | if (pool_count > 0) |
416 | { | 416 | { |
417 | d = MHD_start_daemon (type | MHD_USE_ERROR_LOG | MHD_USE_ITC | poll_flag, | 417 | d = MHD_start_daemon (type | MHD_USE_ERROR_LOG | MHD_USE_ITC |
418 | | (enum MHD_FLAG) poll_flag, | ||
418 | global_port, NULL, NULL, &ahc_echo, NULL, | 419 | global_port, NULL, NULL, &ahc_echo, NULL, |
419 | MHD_OPTION_THREAD_POOL_SIZE, | 420 | MHD_OPTION_THREAD_POOL_SIZE, |
420 | (unsigned int) pool_count, | 421 | (unsigned int) pool_count, |
@@ -423,7 +424,8 @@ testGet (int type, int pool_count, int poll_flag) | |||
423 | } | 424 | } |
424 | else | 425 | else |
425 | { | 426 | { |
426 | d = MHD_start_daemon (type | MHD_USE_ERROR_LOG | MHD_USE_ITC | poll_flag, | 427 | d = MHD_start_daemon (type | MHD_USE_ERROR_LOG | MHD_USE_ITC |
428 | | (enum MHD_FLAG) poll_flag, | ||
427 | global_port, NULL, NULL, &ahc_echo, NULL, | 429 | global_port, NULL, NULL, &ahc_echo, NULL, |
428 | MHD_OPTION_END); | 430 | MHD_OPTION_END); |
429 | } | 431 | } |
@@ -435,7 +437,7 @@ testGet (int type, int pool_count, int poll_flag) | |||
435 | dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT); | 437 | dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT); |
436 | if ((NULL == dinfo) || (0 == dinfo->port) ) | 438 | if ((NULL == dinfo) || (0 == dinfo->port) ) |
437 | mhdErrorExit (); | 439 | mhdErrorExit (); |
438 | global_port = (int) dinfo->port; | 440 | global_port = dinfo->port; |
439 | } | 441 | } |
440 | 442 | ||
441 | c = setupCURL (&cbc); | 443 | c = setupCURL (&cbc); |
@@ -515,8 +517,8 @@ testGet (int type, int pool_count, int poll_flag) | |||
515 | 517 | ||
516 | if (verbose) | 518 | if (verbose) |
517 | { | 519 | { |
518 | printf ("testGet(%d, %d, %d) test succeed.\n", | 520 | printf ("testGet(%u, %d, %u) test succeed.\n", |
519 | type, pool_count, poll_flag); | 521 | type, pool_count, (unsigned int) poll_flag); |
520 | fflush (stdout); | 522 | fflush (stdout); |
521 | } | 523 | } |
522 | 524 | ||
@@ -524,7 +526,7 @@ testGet (int type, int pool_count, int poll_flag) | |||
524 | } | 526 | } |
525 | 527 | ||
526 | 528 | ||
527 | static int | 529 | static unsigned int |
528 | testExternalGet (void) | 530 | testExternalGet (void) |
529 | { | 531 | { |
530 | struct MHD_Daemon *d; | 532 | struct MHD_Daemon *d; |
@@ -564,7 +566,7 @@ testExternalGet (void) | |||
564 | dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT); | 566 | dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT); |
565 | if ((NULL == dinfo) || (0 == dinfo->port) ) | 567 | if ((NULL == dinfo) || (0 == dinfo->port) ) |
566 | mhdErrorExit (); | 568 | mhdErrorExit (); |
567 | global_port = (int) dinfo->port; | 569 | global_port = dinfo->port; |
568 | } | 570 | } |
569 | 571 | ||
570 | for (i = 0; i < 2; i++) | 572 | for (i = 0; i < 2; i++) |
diff --git a/src/testcurl/test_quiesce_stream.c b/src/testcurl/test_quiesce_stream.c index 12b35903..b766012d 100644 --- a/src/testcurl/test_quiesce_stream.c +++ b/src/testcurl/test_quiesce_stream.c | |||
@@ -94,7 +94,7 @@ suspend_connection (struct MHD_Connection *connection) | |||
94 | 94 | ||
95 | struct ContentReaderUserdata | 95 | struct ContentReaderUserdata |
96 | { | 96 | { |
97 | int bytes_written; | 97 | size_t bytes_written; |
98 | struct MHD_Connection *connection; | 98 | struct MHD_Connection *connection; |
99 | }; | 99 | }; |
100 | 100 | ||
@@ -188,7 +188,7 @@ http_AccessHandlerCallback (void *cls, | |||
188 | int | 188 | int |
189 | main (void) | 189 | main (void) |
190 | { | 190 | { |
191 | int port; | 191 | uint16_t port; |
192 | char command_line[1024]; | 192 | char command_line[1024]; |
193 | /* Flags */ | 193 | /* Flags */ |
194 | unsigned int daemon_flags | 194 | unsigned int daemon_flags |
@@ -226,12 +226,12 @@ main (void) | |||
226 | { | 226 | { |
227 | MHD_stop_daemon (daemon); return 32; | 227 | MHD_stop_daemon (daemon); return 32; |
228 | } | 228 | } |
229 | port = (int) dinfo->port; | 229 | port = dinfo->port; |
230 | } | 230 | } |
231 | snprintf (command_line, | 231 | snprintf (command_line, |
232 | sizeof (command_line), | 232 | sizeof (command_line), |
233 | "curl -s http://127.0.0.1:%d", | 233 | "curl -s http://127.0.0.1:%u", |
234 | port); | 234 | (unsigned int) port); |
235 | 235 | ||
236 | if (0 != system (command_line)) | 236 | if (0 != system (command_line)) |
237 | { | 237 | { |
diff --git a/src/testcurl/test_termination.c b/src/testcurl/test_termination.c index 239f10ec..47e873b0 100644 --- a/src/testcurl/test_termination.c +++ b/src/testcurl/test_termination.c | |||
@@ -98,7 +98,7 @@ int | |||
98 | main (void) | 98 | main (void) |
99 | { | 99 | { |
100 | struct MHD_Daemon *daemon; | 100 | struct MHD_Daemon *daemon; |
101 | int port; | 101 | uint16_t port; |
102 | char url[255]; | 102 | char url[255]; |
103 | CURL *curl; | 103 | CURL *curl; |
104 | CURLcode success; | 104 | CURLcode success; |
@@ -129,15 +129,15 @@ main (void) | |||
129 | { | 129 | { |
130 | MHD_stop_daemon (daemon); return 32; | 130 | MHD_stop_daemon (daemon); return 32; |
131 | } | 131 | } |
132 | port = (int) dinfo->port; | 132 | port = dinfo->port; |
133 | } | 133 | } |
134 | 134 | ||
135 | curl = curl_easy_init (); | 135 | curl = curl_easy_init (); |
136 | /* curl_easy_setopt(curl, CURLOPT_POST, 1L); */ | 136 | /* curl_easy_setopt(curl, CURLOPT_POST, 1L); */ |
137 | snprintf (url, | 137 | snprintf (url, |
138 | sizeof (url), | 138 | sizeof (url), |
139 | "http://127.0.0.1:%d", | 139 | "http://127.0.0.1:%u", |
140 | port); | 140 | (unsigned int) port); |
141 | curl_easy_setopt (curl, CURLOPT_URL, url); | 141 | curl_easy_setopt (curl, CURLOPT_URL, url); |
142 | curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION, write_data); | 142 | curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION, write_data); |
143 | 143 | ||
diff --git a/src/testcurl/test_timeout.c b/src/testcurl/test_timeout.c index 404cf040..79f8c88d 100644 --- a/src/testcurl/test_timeout.c +++ b/src/testcurl/test_timeout.c | |||
@@ -149,8 +149,8 @@ termination_cb (void *cls, | |||
149 | static size_t | 149 | static size_t |
150 | putBuffer (void *stream, size_t size, size_t nmemb, void *ptr) | 150 | putBuffer (void *stream, size_t size, size_t nmemb, void *ptr) |
151 | { | 151 | { |
152 | unsigned int *pos = ptr; | 152 | size_t *pos = ptr; |
153 | unsigned int wrt; | 153 | size_t wrt; |
154 | 154 | ||
155 | wrt = size * nmemb; | 155 | wrt = size * nmemb; |
156 | if (wrt > 8 - (*pos)) | 156 | if (wrt > 8 - (*pos)) |
@@ -223,17 +223,17 @@ ahc_echo (void *cls, | |||
223 | } | 223 | } |
224 | 224 | ||
225 | 225 | ||
226 | static int | 226 | static unsigned int |
227 | testWithoutTimeout (void) | 227 | testWithoutTimeout (void) |
228 | { | 228 | { |
229 | struct MHD_Daemon *d; | 229 | struct MHD_Daemon *d; |
230 | CURL *c; | 230 | CURL *c; |
231 | char buf[2048]; | 231 | char buf[2048]; |
232 | struct CBC cbc; | 232 | struct CBC cbc; |
233 | unsigned int pos = 0; | 233 | size_t pos = 0; |
234 | int done_flag = 0; | 234 | int done_flag = 0; |
235 | CURLcode errornum; | 235 | CURLcode errornum; |
236 | int port; | 236 | uint16_t port; |
237 | 237 | ||
238 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 238 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
239 | port = 0; | 239 | port = 0; |
@@ -264,7 +264,7 @@ testWithoutTimeout (void) | |||
264 | { | 264 | { |
265 | MHD_stop_daemon (d); return 32; | 265 | MHD_stop_daemon (d); return 32; |
266 | } | 266 | } |
267 | port = (int) dinfo->port; | 267 | port = dinfo->port; |
268 | } | 268 | } |
269 | c = curl_easy_init (); | 269 | c = curl_easy_init (); |
270 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); | 270 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); |
@@ -310,7 +310,7 @@ testWithoutTimeout (void) | |||
310 | } | 310 | } |
311 | 311 | ||
312 | 312 | ||
313 | static int | 313 | static unsigned int |
314 | testWithTimeout (void) | 314 | testWithTimeout (void) |
315 | { | 315 | { |
316 | struct MHD_Daemon *d; | 316 | struct MHD_Daemon *d; |
@@ -319,7 +319,7 @@ testWithTimeout (void) | |||
319 | struct CBC cbc; | 319 | struct CBC cbc; |
320 | int done_flag = 0; | 320 | int done_flag = 0; |
321 | CURLcode errornum; | 321 | CURLcode errornum; |
322 | int port; | 322 | uint16_t port; |
323 | 323 | ||
324 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 324 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
325 | port = 0; | 325 | port = 0; |
@@ -350,7 +350,7 @@ testWithTimeout (void) | |||
350 | { | 350 | { |
351 | MHD_stop_daemon (d); return 32; | 351 | MHD_stop_daemon (d); return 32; |
352 | } | 352 | } |
353 | port = (int) dinfo->port; | 353 | port = dinfo->port; |
354 | } | 354 | } |
355 | c = curl_easy_init (); | 355 | c = curl_easy_init (); |
356 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); | 356 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); |
diff --git a/src/testcurl/test_toolarge.c b/src/testcurl/test_toolarge.c index 30f0d922..2b94ab7b 100644 --- a/src/testcurl/test_toolarge.c +++ b/src/testcurl/test_toolarge.c | |||
@@ -219,7 +219,7 @@ _mhdErrorExit_func (const char *errDesc, const char *funcName, int lineNum) | |||
219 | /* Global parameters */ | 219 | /* Global parameters */ |
220 | static int verbose; /**< Be verbose */ | 220 | static int verbose; /**< Be verbose */ |
221 | static int oneone; /**< If false use HTTP/1.0 for requests*/ | 221 | static int oneone; /**< If false use HTTP/1.0 for requests*/ |
222 | static int global_port; /**< MHD daemons listen port number */ | 222 | static uint16_t global_port; /**< MHD daemons listen port number */ |
223 | static int large_req_method; /**< Large request method */ | 223 | static int large_req_method; /**< Large request method */ |
224 | static int large_req_url; /**< Large request URL */ | 224 | static int large_req_url; /**< Large request URL */ |
225 | static int large_req_header_name; /**< Large request single header name */ | 225 | static int large_req_header_name; /**< Large request single header name */ |
@@ -256,8 +256,8 @@ test_global_cleanup (void) | |||
256 | struct headers_check_result | 256 | struct headers_check_result |
257 | { | 257 | { |
258 | unsigned int num_n1_headers; | 258 | unsigned int num_n1_headers; |
259 | unsigned int large_header_name_size; | 259 | size_t large_header_name_size; |
260 | unsigned int large_header_value_size; | 260 | size_t large_header_value_size; |
261 | int large_header_valid; | 261 | int large_header_valid; |
262 | }; | 262 | }; |
263 | 263 | ||
@@ -281,7 +281,7 @@ lcurl_hdr_callback (char *buffer, size_t size, size_t nitems, | |||
281 | if (NULL != col_ptr) | 281 | if (NULL != col_ptr) |
282 | { | 282 | { |
283 | const char *const name = buffer; | 283 | const char *const name = buffer; |
284 | const size_t name_len = col_ptr - buffer; | 284 | const size_t name_len = (size_t) (col_ptr - buffer); |
285 | const size_t val_pos = name_len + 2; | 285 | const size_t val_pos = name_len + 2; |
286 | const size_t val_len = data_size - val_pos - 2; /* 2 = strlen("\r\n") */ | 286 | const size_t val_len = data_size - val_pos - 2; /* 2 = strlen("\r\n") */ |
287 | const char *const value = buffer + val_pos; | 287 | const char *const value = buffer + val_pos; |
@@ -367,8 +367,8 @@ check_uri_cb (void *cls, | |||
367 | struct mhd_header_checker_param | 367 | struct mhd_header_checker_param |
368 | { | 368 | { |
369 | unsigned int num_n1_headers; | 369 | unsigned int num_n1_headers; |
370 | unsigned int large_header_name_size; | 370 | size_t large_header_name_size; |
371 | unsigned int large_header_value_size; | 371 | size_t large_header_value_size; |
372 | int large_header_valid; | 372 | int large_header_valid; |
373 | }; | 373 | }; |
374 | 374 | ||
@@ -520,10 +520,10 @@ ahcCheck (void *cls, | |||
520 | externalErrorExit (); | 520 | externalErrorExit (); |
521 | large_hrd_name[0] = '0'; /* Name starts with zero for unique identification */ | 521 | large_hrd_name[0] = '0'; /* Name starts with zero for unique identification */ |
522 | for (i = 1; i < large_hdr_name_size; i++) | 522 | for (i = 1; i < large_hdr_name_size; i++) |
523 | large_hrd_name[i] = 'a' + i % ('z' - 'a' + 1); | 523 | large_hrd_name[i] = 'a' + (char) (unsigned char) (i % ('z' - 'a' + 1)); |
524 | large_hrd_name[large_hdr_name_size] = 0; | 524 | large_hrd_name[large_hdr_name_size] = 0; |
525 | for (i = 0; i < large_hdr_value_size; i++) | 525 | for (i = 0; i < large_hdr_value_size; i++) |
526 | large_hrd_value[i] = 'Z' - i % ('Z' - 'A' + 1); | 526 | large_hrd_value[i] = 'Z' - (char) (unsigned char) (i % ('Z' - 'A' + 1)); |
527 | if (NULL != large_hrd_value) | 527 | if (NULL != large_hrd_value) |
528 | large_hrd_value[large_hdr_value_size] = 0; | 528 | large_hrd_value[large_hdr_value_size] = 0; |
529 | if (MHD_YES != MHD_add_response_header (response, | 529 | if (MHD_YES != MHD_add_response_header (response, |
@@ -549,7 +549,7 @@ ahcCheck (void *cls, | |||
549 | 549 | ||
550 | static CURL * | 550 | static CURL * |
551 | curlEasyInitForTest (const char *queryPath, const char *method, | 551 | curlEasyInitForTest (const char *queryPath, const char *method, |
552 | int port, | 552 | uint16_t port, |
553 | struct lcurl_data_cb_param *dcbp, | 553 | struct lcurl_data_cb_param *dcbp, |
554 | struct headers_check_result *hdr_chk_result, | 554 | struct headers_check_result *hdr_chk_result, |
555 | struct curl_slist *headers) | 555 | struct curl_slist *headers) |
@@ -701,13 +701,13 @@ struct curlQueryParams | |||
701 | const char *method; | 701 | const char *method; |
702 | 702 | ||
703 | /* Destination port for CURL query */ | 703 | /* Destination port for CURL query */ |
704 | int queryPort; | 704 | uint16_t queryPort; |
705 | 705 | ||
706 | /* List of additional request headers */ | 706 | /* List of additional request headers */ |
707 | struct curl_slist *headers; | 707 | struct curl_slist *headers; |
708 | 708 | ||
709 | /* CURL query result error flag */ | 709 | /* CURL query result error flag */ |
710 | volatile int queryError; | 710 | volatile unsigned int queryError; |
711 | 711 | ||
712 | /* Response HTTP code, zero if no response */ | 712 | /* Response HTTP code, zero if no response */ |
713 | volatile int responseCode; | 713 | volatile int responseCode; |
@@ -715,7 +715,7 @@ struct curlQueryParams | |||
715 | 715 | ||
716 | 716 | ||
717 | /* Returns zero for successful response and non-zero for failed response */ | 717 | /* Returns zero for successful response and non-zero for failed response */ |
718 | static int | 718 | static unsigned int |
719 | doCurlQueryInThread (struct MHD_Daemon *d, | 719 | doCurlQueryInThread (struct MHD_Daemon *d, |
720 | struct curlQueryParams *p, | 720 | struct curlQueryParams *p, |
721 | struct headers_check_result *hdr_res, | 721 | struct headers_check_result *hdr_res, |
@@ -810,13 +810,13 @@ doCurlQueryInThread (struct MHD_Daemon *d, | |||
810 | 810 | ||
811 | 811 | ||
812 | /* Perform test queries, shut down MHD daemon, and free parameters */ | 812 | /* Perform test queries, shut down MHD daemon, and free parameters */ |
813 | static int | 813 | static unsigned int |
814 | performTestQueries (struct MHD_Daemon *d, int d_port, | 814 | performTestQueries (struct MHD_Daemon *d, uint16_t d_port, |
815 | struct ahc_cls_type *ahc_param, | 815 | struct ahc_cls_type *ahc_param, |
816 | struct check_uri_cls *uri_cb_param) | 816 | struct check_uri_cls *uri_cb_param) |
817 | { | 817 | { |
818 | struct curlQueryParams qParam; | 818 | struct curlQueryParams qParam; |
819 | int ret = 0; /* Return value */ | 819 | unsigned int ret = 0; /* Return value */ |
820 | struct headers_check_result rp_headers_check; | 820 | struct headers_check_result rp_headers_check; |
821 | char *buf; | 821 | char *buf; |
822 | size_t i; | 822 | size_t i; |
@@ -845,7 +845,7 @@ performTestQueries (struct MHD_Daemon *d, int d_port, | |||
845 | if (large_req_method) | 845 | if (large_req_method) |
846 | { | 846 | { |
847 | for (i = 0; i < TEST_START_SIZE; i++) | 847 | for (i = 0; i < TEST_START_SIZE; i++) |
848 | buf[i] = 'A' + i % ('Z' - 'A' + 1); | 848 | buf[i] = 'A' + (char) (unsigned char) (i % ('Z' - 'A' + 1)); |
849 | for (; i <= TEST_FAIL_SIZE; i++) | 849 | for (; i <= TEST_FAIL_SIZE; i++) |
850 | { | 850 | { |
851 | buf[i] = 0; | 851 | buf[i] = 0; |
@@ -890,7 +890,7 @@ performTestQueries (struct MHD_Daemon *d, int d_port, | |||
890 | if (0 != rp_headers_check.large_header_name_size) | 890 | if (0 != rp_headers_check.large_header_name_size) |
891 | mhdErrorExitDesc ("Detected unexpected large reply header"); | 891 | mhdErrorExitDesc ("Detected unexpected large reply header"); |
892 | 892 | ||
893 | buf[i] = 'A' + i % ('Z' - 'A' + 1); | 893 | buf[i] = 'A' + (char) (unsigned char) (i % ('Z' - 'A' + 1)); |
894 | } | 894 | } |
895 | } | 895 | } |
896 | else if (large_req_url) | 896 | else if (large_req_url) |
@@ -901,7 +901,7 @@ performTestQueries (struct MHD_Daemon *d, int d_port, | |||
901 | memcpy (buf, URL_SCHEME_HOST, base_size); | 901 | memcpy (buf, URL_SCHEME_HOST, base_size); |
902 | url[0] = '/'; | 902 | url[0] = '/'; |
903 | for (i = 1; i < TEST_START_SIZE; i++) | 903 | for (i = 1; i < TEST_START_SIZE; i++) |
904 | url[i] = 'a' + i % ('z' - 'a' + 1); | 904 | url[i] = 'a' + (char) (unsigned char) (i % ('z' - 'a' + 1)); |
905 | for (; i <= TEST_FAIL_SIZE; i++) | 905 | for (; i <= TEST_FAIL_SIZE; i++) |
906 | { | 906 | { |
907 | url[i] = 0; | 907 | url[i] = 0; |
@@ -947,14 +947,14 @@ performTestQueries (struct MHD_Daemon *d, int d_port, | |||
947 | if (0 != rp_headers_check.large_header_name_size) | 947 | if (0 != rp_headers_check.large_header_name_size) |
948 | mhdErrorExitDesc ("Detected unexpected large reply header"); | 948 | mhdErrorExitDesc ("Detected unexpected large reply header"); |
949 | 949 | ||
950 | url[i] = 'a' + i % ('z' - 'a' + 1); | 950 | url[i] = 'a' + (char) (unsigned char) (i % ('z' - 'a' + 1)); |
951 | } | 951 | } |
952 | } | 952 | } |
953 | else if (large_req_header_name) | 953 | else if (large_req_header_name) |
954 | { | 954 | { |
955 | buf[0] = '0'; /* Name starts with zero for unique identification */ | 955 | buf[0] = '0'; /* Name starts with zero for unique identification */ |
956 | for (i = 1; i < TEST_START_SIZE; i++) | 956 | for (i = 1; i < TEST_START_SIZE; i++) |
957 | buf[i] = 'a' + i % ('z' - 'a' + 1); | 957 | buf[i] = 'a' + (char) (unsigned char) (i % ('z' - 'a' + 1)); |
958 | for (; i <= TEST_FAIL_SIZE; i++) | 958 | for (; i <= TEST_FAIL_SIZE; i++) |
959 | { | 959 | { |
960 | struct curl_slist *curl_headers; | 960 | struct curl_slist *curl_headers; |
@@ -1020,7 +1020,7 @@ performTestQueries (struct MHD_Daemon *d, int d_port, | |||
1020 | mhdErrorExitDesc ("Detected unexpected large reply header"); | 1020 | mhdErrorExitDesc ("Detected unexpected large reply header"); |
1021 | 1021 | ||
1022 | curl_slist_free_all (curl_headers); | 1022 | curl_slist_free_all (curl_headers); |
1023 | buf[i] = 'a' + i % ('z' - 'a' + 1); | 1023 | buf[i] = 'a' + (char) (unsigned char) (i % ('z' - 'a' + 1)); |
1024 | } | 1024 | } |
1025 | } | 1025 | } |
1026 | else if (large_req_header_value) | 1026 | else if (large_req_header_value) |
@@ -1029,7 +1029,7 @@ performTestQueries (struct MHD_Daemon *d, int d_port, | |||
1029 | /* Name starts with zero for unique identification */ | 1029 | /* Name starts with zero for unique identification */ |
1030 | memcpy (buf, "0: ", 3); /* Note: strlen(": Z") is less than strlen(URL_SCHEME_HOST) */ | 1030 | memcpy (buf, "0: ", 3); /* Note: strlen(": Z") is less than strlen(URL_SCHEME_HOST) */ |
1031 | for (i = 0; i < TEST_START_SIZE; i++) | 1031 | for (i = 0; i < TEST_START_SIZE; i++) |
1032 | hdr_value[i] = 'Z' - i % ('Z' - 'A' + 1); | 1032 | hdr_value[i] = 'Z' - (char) (unsigned char) (i % ('Z' - 'A' + 1)); |
1033 | for (; i <= TEST_FAIL_SIZE; i++) | 1033 | for (; i <= TEST_FAIL_SIZE; i++) |
1034 | { | 1034 | { |
1035 | struct curl_slist *curl_headers; | 1035 | struct curl_slist *curl_headers; |
@@ -1094,7 +1094,7 @@ performTestQueries (struct MHD_Daemon *d, int d_port, | |||
1094 | mhdErrorExitDesc ("Detected unexpected large reply header"); | 1094 | mhdErrorExitDesc ("Detected unexpected large reply header"); |
1095 | 1095 | ||
1096 | curl_slist_free_all (curl_headers); | 1096 | curl_slist_free_all (curl_headers); |
1097 | hdr_value[i] = 'Z' - i % ('Z' - 'A' + 1); | 1097 | hdr_value[i] = 'Z' - (char) (unsigned char) (i % ('Z' - 'A' + 1)); |
1098 | } | 1098 | } |
1099 | } | 1099 | } |
1100 | else if (large_req_headers) | 1100 | else if (large_req_headers) |
@@ -1353,7 +1353,7 @@ enum testMhdPollType | |||
1353 | static unsigned int | 1353 | static unsigned int |
1354 | testNumThreadsForPool (enum testMhdPollType pollType) | 1354 | testNumThreadsForPool (enum testMhdPollType pollType) |
1355 | { | 1355 | { |
1356 | int numThreads = MHD_CPU_COUNT; | 1356 | unsigned int numThreads = MHD_CPU_COUNT; |
1357 | (void) pollType; /* Don't care about pollType for this test */ | 1357 | (void) pollType; /* Don't care about pollType for this test */ |
1358 | return numThreads; /* No practical limit for non-cleanup test */ | 1358 | return numThreads; /* No practical limit for non-cleanup test */ |
1359 | } | 1359 | } |
@@ -1361,7 +1361,7 @@ testNumThreadsForPool (enum testMhdPollType pollType) | |||
1361 | 1361 | ||
1362 | static struct MHD_Daemon * | 1362 | static struct MHD_Daemon * |
1363 | startTestMhdDaemon (enum testMhdThreadsType thrType, | 1363 | startTestMhdDaemon (enum testMhdThreadsType thrType, |
1364 | enum testMhdPollType pollType, int *pport, | 1364 | enum testMhdPollType pollType, uint16_t *pport, |
1365 | struct ahc_cls_type **ahc_param, | 1365 | struct ahc_cls_type **ahc_param, |
1366 | struct check_uri_cls **uri_cb_param) | 1366 | struct check_uri_cls **uri_cb_param) |
1367 | { | 1367 | { |
@@ -1404,7 +1404,7 @@ startTestMhdDaemon (enum testMhdThreadsType thrType, | |||
1404 | } | 1404 | } |
1405 | 1405 | ||
1406 | if (testMhdThreadInternalPool != thrType) | 1406 | if (testMhdThreadInternalPool != thrType) |
1407 | d = MHD_start_daemon (((int) thrType) | ((int) pollType) | 1407 | d = MHD_start_daemon (((unsigned int) thrType) | ((unsigned int) pollType) |
1408 | | (verbose ? MHD_USE_ERROR_LOG : 0), | 1408 | | (verbose ? MHD_USE_ERROR_LOG : 0), |
1409 | *pport, NULL, NULL, | 1409 | *pport, NULL, NULL, |
1410 | &ahcCheck, *ahc_param, | 1410 | &ahcCheck, *ahc_param, |
@@ -1414,7 +1414,8 @@ startTestMhdDaemon (enum testMhdThreadsType thrType, | |||
1414 | (size_t) BUFFER_SIZE, | 1414 | (size_t) BUFFER_SIZE, |
1415 | MHD_OPTION_END); | 1415 | MHD_OPTION_END); |
1416 | else | 1416 | else |
1417 | d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | ((int) pollType) | 1417 | d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD |
1418 | | ((unsigned int) pollType) | ||
1418 | | (verbose ? MHD_USE_ERROR_LOG : 0), | 1419 | | (verbose ? MHD_USE_ERROR_LOG : 0), |
1419 | *pport, NULL, NULL, | 1420 | *pport, NULL, NULL, |
1420 | &ahcCheck, *ahc_param, | 1421 | &ahcCheck, *ahc_param, |
@@ -1440,7 +1441,7 @@ startTestMhdDaemon (enum testMhdThreadsType thrType, | |||
1440 | fprintf (stderr, "MHD_get_daemon_info() failed.\n"); | 1441 | fprintf (stderr, "MHD_get_daemon_info() failed.\n"); |
1441 | abort (); | 1442 | abort (); |
1442 | } | 1443 | } |
1443 | *pport = (int) dinfo->port; | 1444 | *pport = dinfo->port; |
1444 | if (0 == global_port) | 1445 | if (0 == global_port) |
1445 | global_port = *pport; /* Reuse the same port for all tests */ | 1446 | global_port = *pport; /* Reuse the same port for all tests */ |
1446 | } | 1447 | } |
@@ -1452,11 +1453,11 @@ startTestMhdDaemon (enum testMhdThreadsType thrType, | |||
1452 | /* Test runners */ | 1453 | /* Test runners */ |
1453 | 1454 | ||
1454 | 1455 | ||
1455 | static int | 1456 | static unsigned int |
1456 | testExternalGet (void) | 1457 | testExternalGet (void) |
1457 | { | 1458 | { |
1458 | struct MHD_Daemon *d; | 1459 | struct MHD_Daemon *d; |
1459 | int d_port = global_port; /* Daemon's port */ | 1460 | uint16_t d_port = global_port; /* Daemon's port */ |
1460 | struct ahc_cls_type *ahc_param; | 1461 | struct ahc_cls_type *ahc_param; |
1461 | struct check_uri_cls *uri_cb_param; | 1462 | struct check_uri_cls *uri_cb_param; |
1462 | 1463 | ||
@@ -1467,11 +1468,11 @@ testExternalGet (void) | |||
1467 | } | 1468 | } |
1468 | 1469 | ||
1469 | 1470 | ||
1470 | static int | 1471 | static unsigned int |
1471 | testInternalGet (enum testMhdPollType pollType) | 1472 | testInternalGet (enum testMhdPollType pollType) |
1472 | { | 1473 | { |
1473 | struct MHD_Daemon *d; | 1474 | struct MHD_Daemon *d; |
1474 | int d_port = global_port; /* Daemon's port */ | 1475 | uint16_t d_port = global_port; /* Daemon's port */ |
1475 | struct ahc_cls_type *ahc_param; | 1476 | struct ahc_cls_type *ahc_param; |
1476 | struct check_uri_cls *uri_cb_param; | 1477 | struct check_uri_cls *uri_cb_param; |
1477 | 1478 | ||
@@ -1482,11 +1483,11 @@ testInternalGet (enum testMhdPollType pollType) | |||
1482 | } | 1483 | } |
1483 | 1484 | ||
1484 | 1485 | ||
1485 | static int | 1486 | static unsigned int |
1486 | testMultithreadedGet (enum testMhdPollType pollType) | 1487 | testMultithreadedGet (enum testMhdPollType pollType) |
1487 | { | 1488 | { |
1488 | struct MHD_Daemon *d; | 1489 | struct MHD_Daemon *d; |
1489 | int d_port = global_port; /* Daemon's port */ | 1490 | uint16_t d_port = global_port; /* Daemon's port */ |
1490 | struct ahc_cls_type *ahc_param; | 1491 | struct ahc_cls_type *ahc_param; |
1491 | struct check_uri_cls *uri_cb_param; | 1492 | struct check_uri_cls *uri_cb_param; |
1492 | 1493 | ||
@@ -1496,11 +1497,11 @@ testMultithreadedGet (enum testMhdPollType pollType) | |||
1496 | } | 1497 | } |
1497 | 1498 | ||
1498 | 1499 | ||
1499 | static int | 1500 | static unsigned int |
1500 | testMultithreadedPoolGet (enum testMhdPollType pollType) | 1501 | testMultithreadedPoolGet (enum testMhdPollType pollType) |
1501 | { | 1502 | { |
1502 | struct MHD_Daemon *d; | 1503 | struct MHD_Daemon *d; |
1503 | int d_port = global_port; /* Daemon's port */ | 1504 | uint16_t d_port = global_port; /* Daemon's port */ |
1504 | struct ahc_cls_type *ahc_param; | 1505 | struct ahc_cls_type *ahc_param; |
1505 | struct check_uri_cls *uri_cb_param; | 1506 | struct check_uri_cls *uri_cb_param; |
1506 | 1507 | ||
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 */ |
212 | static int verbose; /**< Be verbose */ | 212 | static int verbose; /**< Be verbose */ |
213 | static int oneone; /**< If false use HTTP/1.0 for requests*/ | 213 | static int oneone; /**< If false use HTTP/1.0 for requests*/ |
214 | static int global_port; /**< MHD daemons listen port number */ | 214 | static uint16_t global_port; /**< MHD daemons listen port number */ |
215 | static int response_timeout_val = TIMEOUTS_VAL; | 215 | static int response_timeout_val = TIMEOUTS_VAL; |
216 | 216 | ||
217 | static int tricky_url; /**< Tricky request URL */ | 217 | static 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 */ |
626 | static int | 626 | static unsigned int |
627 | doCurlQueryInThread (struct MHD_Daemon *d, | 627 | doCurlQueryInThread (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 */ |
725 | static int | 725 | static unsigned int |
726 | performTestQueries (struct MHD_Daemon *d, int d_port, | 726 | performTestQueries (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 | |||
923 | static unsigned int | 923 | static unsigned int |
924 | testNumThreadsForPool (enum testMhdPollType pollType) | 924 | testNumThreadsForPool (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 | ||
932 | static struct MHD_Daemon * | 932 | static struct MHD_Daemon * |
933 | startTestMhdDaemon (enum testMhdThreadsType thrType, | 933 | startTestMhdDaemon (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 | ||
1009 | static int | 1010 | static unsigned int |
1010 | testExternalGet (void) | 1011 | testExternalGet (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 | ||
1024 | static int | 1025 | static unsigned int |
1025 | testInternalGet (enum testMhdPollType pollType) | 1026 | testInternalGet (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 | ||
1039 | static int | 1040 | static unsigned int |
1040 | testMultithreadedGet (enum testMhdPollType pollType) | 1041 | testMultithreadedGet (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 | ||
1053 | static int | 1054 | static unsigned int |
1054 | testMultithreadedPoolGet (enum testMhdPollType pollType) | 1055 | testMultithreadedPoolGet (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 | ||
diff --git a/src/testcurl/test_urlparse.c b/src/testcurl/test_urlparse.c index 71ac668b..18c6ab37 100644 --- a/src/testcurl/test_urlparse.c +++ b/src/testcurl/test_urlparse.c | |||
@@ -128,15 +128,15 @@ ahc_echo (void *cls, | |||
128 | } | 128 | } |
129 | 129 | ||
130 | 130 | ||
131 | static int | 131 | static unsigned int |
132 | testInternalGet (int poll_flag) | 132 | testInternalGet (uint32_t poll_flag) |
133 | { | 133 | { |
134 | struct MHD_Daemon *d; | 134 | struct MHD_Daemon *d; |
135 | CURL *c; | 135 | CURL *c; |
136 | char buf[2048]; | 136 | char buf[2048]; |
137 | struct CBC cbc; | 137 | struct CBC cbc; |
138 | CURLcode errornum; | 138 | CURLcode errornum; |
139 | int port; | 139 | uint16_t port; |
140 | 140 | ||
141 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 141 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
142 | port = 0; | 142 | port = 0; |
@@ -151,7 +151,7 @@ testInternalGet (int poll_flag) | |||
151 | cbc.size = 2048; | 151 | cbc.size = 2048; |
152 | cbc.pos = 0; | 152 | cbc.pos = 0; |
153 | d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | 153 | d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG |
154 | | poll_flag, | 154 | | (enum MHD_FLAG) poll_flag, |
155 | port, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END); | 155 | port, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END); |
156 | if (d == NULL) | 156 | if (d == NULL) |
157 | return 1; | 157 | return 1; |
@@ -163,7 +163,7 @@ testInternalGet (int poll_flag) | |||
163 | { | 163 | { |
164 | MHD_stop_daemon (d); return 32; | 164 | MHD_stop_daemon (d); return 32; |
165 | } | 165 | } |
166 | port = (int) dinfo->port; | 166 | port = dinfo->port; |
167 | } | 167 | } |
168 | c = curl_easy_init (); | 168 | c = curl_easy_init (); |
169 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world?a=b&c=&d"); | 169 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world?a=b&c=&d"); |
diff --git a/src/testzzuf/test_get.c b/src/testzzuf/test_get.c index 313ab1da..e2b86ffe 100644 --- a/src/testzzuf/test_get.c +++ b/src/testzzuf/test_get.c | |||
@@ -104,7 +104,7 @@ ahc_echo (void *cls, | |||
104 | } | 104 | } |
105 | 105 | ||
106 | 106 | ||
107 | static int | 107 | static unsigned int |
108 | testInternalGet () | 108 | testInternalGet () |
109 | { | 109 | { |
110 | struct MHD_Daemon *d; | 110 | struct MHD_Daemon *d; |
@@ -150,7 +150,7 @@ testInternalGet () | |||
150 | } | 150 | } |
151 | 151 | ||
152 | 152 | ||
153 | static int | 153 | static unsigned int |
154 | testMultithreadedGet () | 154 | testMultithreadedGet () |
155 | { | 155 | { |
156 | struct MHD_Daemon *d; | 156 | struct MHD_Daemon *d; |
@@ -196,7 +196,7 @@ testMultithreadedGet () | |||
196 | } | 196 | } |
197 | 197 | ||
198 | 198 | ||
199 | static int | 199 | static unsigned int |
200 | testExternalGet () | 200 | testExternalGet () |
201 | { | 201 | { |
202 | struct MHD_Daemon *d; | 202 | struct MHD_Daemon *d; |
diff --git a/src/testzzuf/test_get_chunked.c b/src/testzzuf/test_get_chunked.c index ff49cd5f..8013494f 100644 --- a/src/testzzuf/test_get_chunked.c +++ b/src/testzzuf/test_get_chunked.c | |||
@@ -146,7 +146,7 @@ ahc_echo (void *cls, | |||
146 | } | 146 | } |
147 | 147 | ||
148 | 148 | ||
149 | static int | 149 | static unsigned int |
150 | testInternalGet () | 150 | testInternalGet () |
151 | { | 151 | { |
152 | struct MHD_Daemon *d; | 152 | struct MHD_Daemon *d; |
@@ -189,7 +189,7 @@ testInternalGet () | |||
189 | } | 189 | } |
190 | 190 | ||
191 | 191 | ||
192 | static int | 192 | static unsigned int |
193 | testMultithreadedGet () | 193 | testMultithreadedGet () |
194 | { | 194 | { |
195 | struct MHD_Daemon *d; | 195 | struct MHD_Daemon *d; |
@@ -232,7 +232,7 @@ testMultithreadedGet () | |||
232 | } | 232 | } |
233 | 233 | ||
234 | 234 | ||
235 | static int | 235 | static unsigned int |
236 | testExternalGet () | 236 | testExternalGet () |
237 | { | 237 | { |
238 | struct MHD_Daemon *d; | 238 | struct MHD_Daemon *d; |
diff --git a/src/testzzuf/test_long_header.c b/src/testzzuf/test_long_header.c index 7213ee41..c0259398 100644 --- a/src/testzzuf/test_long_header.c +++ b/src/testzzuf/test_long_header.c | |||
@@ -106,7 +106,7 @@ ahc_echo (void *cls, | |||
106 | } | 106 | } |
107 | 107 | ||
108 | 108 | ||
109 | static int | 109 | static unsigned int |
110 | testLongUrlGet () | 110 | testLongUrlGet () |
111 | { | 111 | { |
112 | struct MHD_Daemon *d; | 112 | struct MHD_Daemon *d; |
@@ -173,7 +173,7 @@ testLongUrlGet () | |||
173 | } | 173 | } |
174 | 174 | ||
175 | 175 | ||
176 | static int | 176 | static unsigned int |
177 | testLongHeaderGet () | 177 | testLongHeaderGet () |
178 | { | 178 | { |
179 | struct MHD_Daemon *d; | 179 | struct MHD_Daemon *d; |
diff --git a/src/testzzuf/test_post.c b/src/testzzuf/test_post.c index 29a14ce8..895c5fce 100644 --- a/src/testzzuf/test_post.c +++ b/src/testzzuf/test_post.c | |||
@@ -160,7 +160,7 @@ ahc_echo (void *cls, | |||
160 | } | 160 | } |
161 | 161 | ||
162 | 162 | ||
163 | static int | 163 | static unsigned int |
164 | testInternalPost () | 164 | testInternalPost () |
165 | { | 165 | { |
166 | struct MHD_Daemon *d; | 166 | struct MHD_Daemon *d; |
@@ -213,7 +213,7 @@ testInternalPost () | |||
213 | } | 213 | } |
214 | 214 | ||
215 | 215 | ||
216 | static int | 216 | static unsigned int |
217 | testMultithreadedPost () | 217 | testMultithreadedPost () |
218 | { | 218 | { |
219 | struct MHD_Daemon *d; | 219 | struct MHD_Daemon *d; |
@@ -267,7 +267,7 @@ testMultithreadedPost () | |||
267 | } | 267 | } |
268 | 268 | ||
269 | 269 | ||
270 | static int | 270 | static unsigned int |
271 | testExternalPost () | 271 | testExternalPost () |
272 | { | 272 | { |
273 | struct MHD_Daemon *d; | 273 | struct MHD_Daemon *d; |
diff --git a/src/testzzuf/test_post_form.c b/src/testzzuf/test_post_form.c index faeefb98..b16b0cdd 100644 --- a/src/testzzuf/test_post_form.c +++ b/src/testzzuf/test_post_form.c | |||
@@ -179,7 +179,7 @@ make_form () | |||
179 | } | 179 | } |
180 | 180 | ||
181 | 181 | ||
182 | static int | 182 | static unsigned int |
183 | testInternalPost () | 183 | testInternalPost () |
184 | { | 184 | { |
185 | struct MHD_Daemon *d; | 185 | struct MHD_Daemon *d; |
@@ -231,7 +231,7 @@ testInternalPost () | |||
231 | } | 231 | } |
232 | 232 | ||
233 | 233 | ||
234 | static int | 234 | static unsigned int |
235 | testMultithreadedPost () | 235 | testMultithreadedPost () |
236 | { | 236 | { |
237 | struct MHD_Daemon *d; | 237 | struct MHD_Daemon *d; |
@@ -283,7 +283,7 @@ testMultithreadedPost () | |||
283 | } | 283 | } |
284 | 284 | ||
285 | 285 | ||
286 | static int | 286 | static unsigned int |
287 | testExternalPost () | 287 | testExternalPost () |
288 | { | 288 | { |
289 | struct MHD_Daemon *d; | 289 | struct MHD_Daemon *d; |
diff --git a/src/testzzuf/test_put.c b/src/testzzuf/test_put.c index eba9d1fa..9e3749d1 100644 --- a/src/testzzuf/test_put.c +++ b/src/testzzuf/test_put.c | |||
@@ -127,7 +127,7 @@ ahc_echo (void *cls, | |||
127 | } | 127 | } |
128 | 128 | ||
129 | 129 | ||
130 | static int | 130 | static unsigned int |
131 | testInternalPut () | 131 | testInternalPut () |
132 | { | 132 | { |
133 | struct MHD_Daemon *d; | 133 | struct MHD_Daemon *d; |
@@ -180,7 +180,7 @@ testInternalPut () | |||
180 | } | 180 | } |
181 | 181 | ||
182 | 182 | ||
183 | static int | 183 | static unsigned int |
184 | testMultithreadedPut () | 184 | testMultithreadedPut () |
185 | { | 185 | { |
186 | struct MHD_Daemon *d; | 186 | struct MHD_Daemon *d; |
@@ -233,7 +233,7 @@ testMultithreadedPut () | |||
233 | } | 233 | } |
234 | 234 | ||
235 | 235 | ||
236 | static int | 236 | static unsigned int |
237 | testExternalPut () | 237 | testExternalPut () |
238 | { | 238 | { |
239 | struct MHD_Daemon *d; | 239 | struct MHD_Daemon *d; |
diff --git a/src/testzzuf/test_put_chunked.c b/src/testzzuf/test_put_chunked.c index 34c03215..3dd67e43 100644 --- a/src/testzzuf/test_put_chunked.c +++ b/src/testzzuf/test_put_chunked.c | |||
@@ -137,7 +137,7 @@ ahc_echo (void *cls, | |||
137 | } | 137 | } |
138 | 138 | ||
139 | 139 | ||
140 | static int | 140 | static unsigned int |
141 | testInternalPut () | 141 | testInternalPut () |
142 | { | 142 | { |
143 | struct MHD_Daemon *d; | 143 | struct MHD_Daemon *d; |
@@ -190,7 +190,7 @@ testInternalPut () | |||
190 | } | 190 | } |
191 | 191 | ||
192 | 192 | ||
193 | static int | 193 | static unsigned int |
194 | testMultithreadedPut () | 194 | testMultithreadedPut () |
195 | { | 195 | { |
196 | struct MHD_Daemon *d; | 196 | struct MHD_Daemon *d; |
@@ -249,7 +249,7 @@ testMultithreadedPut () | |||
249 | } | 249 | } |
250 | 250 | ||
251 | 251 | ||
252 | static int | 252 | static unsigned int |
253 | testExternalPut () | 253 | testExternalPut () |
254 | { | 254 | { |
255 | struct MHD_Daemon *d; | 255 | struct MHD_Daemon *d; |
diff --git a/src/testzzuf/test_put_large.c b/src/testzzuf/test_put_large.c index 6da41473..900284ef 100644 --- a/src/testzzuf/test_put_large.c +++ b/src/testzzuf/test_put_large.c | |||
@@ -141,7 +141,7 @@ ahc_echo (void *cls, | |||
141 | } | 141 | } |
142 | 142 | ||
143 | 143 | ||
144 | static int | 144 | static unsigned int |
145 | testInternalPut () | 145 | testInternalPut () |
146 | { | 146 | { |
147 | struct MHD_Daemon *d; | 147 | struct MHD_Daemon *d; |
@@ -195,7 +195,7 @@ testInternalPut () | |||
195 | } | 195 | } |
196 | 196 | ||
197 | 197 | ||
198 | static int | 198 | static unsigned int |
199 | testMultithreadedPut () | 199 | testMultithreadedPut () |
200 | { | 200 | { |
201 | struct MHD_Daemon *d; | 201 | struct MHD_Daemon *d; |
@@ -249,7 +249,7 @@ testMultithreadedPut () | |||
249 | } | 249 | } |
250 | 250 | ||
251 | 251 | ||
252 | static int | 252 | static unsigned int |
253 | testExternalPut () | 253 | testExternalPut () |
254 | { | 254 | { |
255 | struct MHD_Daemon *d; | 255 | struct MHD_Daemon *d; |