aboutsummaryrefslogtreecommitdiff
path: root/src/testcurl/perf_get.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testcurl/perf_get.c')
-rw-r--r--src/testcurl/perf_get.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/testcurl/perf_get.c b/src/testcurl/perf_get.c
index 112046d5..53992b17 100644
--- a/src/testcurl/perf_get.c
+++ b/src/testcurl/perf_get.c
@@ -150,6 +150,7 @@ copyBuffer (void *ptr,
150 return size * nmemb; 150 return size * nmemb;
151} 151}
152 152
153
153static int 154static int
154ahc_echo (void *cls, 155ahc_echo (void *cls,
155 struct MHD_Connection *connection, 156 struct MHD_Connection *connection,
@@ -205,7 +206,7 @@ testInternalGet (int port, int poll_flag)
205 { 206 {
206 const union MHD_DaemonInfo *dinfo; 207 const union MHD_DaemonInfo *dinfo;
207 dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT); 208 dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
208 if ((NULL == dinfo) ||(0 == dinfo->port) ) 209 if ((NULL == dinfo) || (0 == dinfo->port) )
209 { 210 {
210 MHD_stop_daemon (d); return 32; 211 MHD_stop_daemon (d); return 32;
211 } 212 }
@@ -284,7 +285,7 @@ testMultithreadedGet (int port, int poll_flag)
284 { 285 {
285 const union MHD_DaemonInfo *dinfo; 286 const union MHD_DaemonInfo *dinfo;
286 dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT); 287 dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
287 if ((NULL == dinfo) ||(0 == dinfo->port) ) 288 if ((NULL == dinfo) || (0 == dinfo->port) )
288 { 289 {
289 MHD_stop_daemon (d); return 32; 290 MHD_stop_daemon (d); return 32;
290 } 291 }
@@ -339,6 +340,7 @@ testMultithreadedGet (int port, int poll_flag)
339 return 0; 340 return 0;
340} 341}
341 342
343
342static int 344static int
343testMultithreadedPoolGet (int port, int poll_flag) 345testMultithreadedPoolGet (int port, int poll_flag)
344{ 346{
@@ -365,7 +367,7 @@ testMultithreadedPoolGet (int port, int poll_flag)
365 { 367 {
366 const union MHD_DaemonInfo *dinfo; 368 const union MHD_DaemonInfo *dinfo;
367 dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT); 369 dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
368 if ((NULL == dinfo) ||(0 == dinfo->port) ) 370 if ((NULL == dinfo) || (0 == dinfo->port) )
369 { 371 {
370 MHD_stop_daemon (d); return 32; 372 MHD_stop_daemon (d); return 32;
371 } 373 }
@@ -417,6 +419,7 @@ testMultithreadedPoolGet (int port, int poll_flag)
417 return 0; 419 return 0;
418} 420}
419 421
422
420static int 423static int
421testExternalGet (int port) 424testExternalGet (int port)
422{ 425{
@@ -458,7 +461,7 @@ testExternalGet (int port)
458 { 461 {
459 const union MHD_DaemonInfo *dinfo; 462 const union MHD_DaemonInfo *dinfo;
460 dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT); 463 dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
461 if ((NULL == dinfo) ||(0 == dinfo->port) ) 464 if ((NULL == dinfo) || (0 == dinfo->port) )
462 { 465 {
463 MHD_stop_daemon (d); return 32; 466 MHD_stop_daemon (d); return 32;
464 } 467 }
@@ -535,10 +538,10 @@ testExternalGet (int port)
535 if (EINTR != errno) 538 if (EINTR != errno)
536 abort (); 539 abort ();
537#else 540#else
538 if ((WSAEINVAL != WSAGetLastError ()) ||(0 != rs.fd_count) ||(0 != 541 if ((WSAEINVAL != WSAGetLastError ()) || (0 != rs.fd_count) || (0 !=
539 ws. 542 ws.
540 fd_count) 543 fd_count)
541 ||(0 != es.fd_count) ) 544 || (0 != es.fd_count) )
542 abort (); 545 abort ();
543 Sleep (1000); 546 Sleep (1000);
544#endif 547#endif
@@ -566,8 +569,7 @@ testExternalGet (int port)
566 in actual runtime right now, even though the 569 in actual runtime right now, even though the
567 number of select calls is virtually cut in half 570 number of select calls is virtually cut in half
568 (and 'select' is the most expensive of our system 571 (and 'select' is the most expensive of our system
569 calls according to 'strace') */ 572 calls according to 'strace') */if (0)
570 if (0)
571 MHD_run (d); 573 MHD_run (d);
572 else 574 else
573 MHD_run_from_select (d, &rs, &ws, &es); 575 MHD_run_from_select (d, &rs, &ws, &es);
@@ -600,7 +602,7 @@ main (int argc, char *const *argv)
600 int port = 1130; 602 int port = 1130;
601 (void) argc; /* Unused. Silent compiler warning. */ 603 (void) argc; /* Unused. Silent compiler warning. */
602 604
603 if ((NULL == argv)||(0 == argv[0])) 605 if ((NULL == argv) || (0 == argv[0]))
604 return 99; 606 return 99;
605 oneone = has_in_name (argv[0], "11"); 607 oneone = has_in_name (argv[0], "11");
606 if (oneone) 608 if (oneone)