diff options
Diffstat (limited to 'src/testcurl/perf_get_concurrent.c')
-rw-r--r-- | src/testcurl/perf_get_concurrent.c | 32 |
1 files changed, 16 insertions, 16 deletions
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])) |