diff options
Diffstat (limited to 'src/testcurl/test_get_chunked.c')
-rw-r--r-- | src/testcurl/test_get_chunked.c | 38 |
1 files changed, 21 insertions, 17 deletions
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 | } |