aboutsummaryrefslogtreecommitdiff
path: root/src/testcurl/test_get_sendfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testcurl/test_get_sendfile.c')
-rw-r--r--src/testcurl/test_get_sendfile.c36
1 files changed, 18 insertions, 18 deletions
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
122static int 122static unsigned int
123testInternalGet (void) 123testInternalGet (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
193static int 193static unsigned int
194testMultithreadedGet (void) 194testMultithreadedGet (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
265static int 265static unsigned int
266testMultithreadedPoolGet (void) 266testMultithreadedPoolGet (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
338static int 338static unsigned int
339testExternalGet (void) 339testExternalGet (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
529static int 529static unsigned int
530testUnknownPortGet (void) 530testUnknownPortGet (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);