diff options
Diffstat (limited to 'src/testcurl/perf_get.c')
-rw-r--r-- | src/testcurl/perf_get.c | 48 |
1 files changed, 31 insertions, 17 deletions
diff --git a/src/testcurl/perf_get.c b/src/testcurl/perf_get.c index 0627bf53..90aa6d25 100644 --- a/src/testcurl/perf_get.c +++ b/src/testcurl/perf_get.c | |||
@@ -225,7 +225,7 @@ testInternalGet (int port, int poll_flag) | |||
225 | "http://127.0.0.1:%d/hello_world", | 225 | "http://127.0.0.1:%d/hello_world", |
226 | port); | 226 | port); |
227 | start_timer (); | 227 | start_timer (); |
228 | for (i = 0; i<ROUNDS; i++) | 228 | for (i = 0; i < ROUNDS; i++) |
229 | { | 229 | { |
230 | cbc.pos = 0; | 230 | cbc.pos = 0; |
231 | c = curl_easy_init (); | 231 | c = curl_easy_init (); |
@@ -304,7 +304,7 @@ testMultithreadedGet (int port, int poll_flag) | |||
304 | "http://127.0.0.1:%d/hello_world", | 304 | "http://127.0.0.1:%d/hello_world", |
305 | port); | 305 | port); |
306 | start_timer (); | 306 | start_timer (); |
307 | for (i = 0; i<ROUNDS; i++) | 307 | for (i = 0; i < ROUNDS; i++) |
308 | { | 308 | { |
309 | cbc.pos = 0; | 309 | cbc.pos = 0; |
310 | c = curl_easy_init (); | 310 | c = curl_easy_init (); |
@@ -387,7 +387,7 @@ testMultithreadedPoolGet (int port, int poll_flag) | |||
387 | "http://127.0.0.1:%d/hello_world", | 387 | "http://127.0.0.1:%d/hello_world", |
388 | port); | 388 | port); |
389 | start_timer (); | 389 | start_timer (); |
390 | for (i = 0; i<ROUNDS; i++) | 390 | for (i = 0; i < ROUNDS; i++) |
391 | { | 391 | { |
392 | cbc.pos = 0; | 392 | cbc.pos = 0; |
393 | c = curl_easy_init (); | 393 | c = curl_easy_init (); |
@@ -487,7 +487,7 @@ testExternalGet (int port) | |||
487 | MHD_stop_daemon (d); | 487 | MHD_stop_daemon (d); |
488 | return 512; | 488 | return 512; |
489 | } | 489 | } |
490 | for (i = 0; i<ROUNDS; i++) | 490 | for (i = 0; i < ROUNDS; i++) |
491 | { | 491 | { |
492 | cbc.pos = 0; | 492 | cbc.pos = 0; |
493 | c = curl_easy_init (); | 493 | c = curl_easy_init (); |
@@ -556,22 +556,36 @@ testExternalGet (int port) | |||
556 | #endif | 556 | #endif |
557 | } | 557 | } |
558 | curl_multi_perform (multi, &running); | 558 | curl_multi_perform (multi, &running); |
559 | if (running == 0) | 559 | if (0 == running) |
560 | { | 560 | { |
561 | msg = curl_multi_info_read (multi, &running); | 561 | int pending; |
562 | if (msg == NULL) | 562 | int curl_fine = 0; |
563 | break; | 563 | while (NULL != (msg = curl_multi_info_read (multi, &pending))) |
564 | if (msg->msg == CURLMSG_DONE) | ||
565 | { | 564 | { |
566 | if (msg->data.result != CURLE_OK) | 565 | if (msg->msg == CURLMSG_DONE) |
567 | printf ("%s failed at %s:%d: `%s'\n", | 566 | { |
568 | "curl_multi_perform", | 567 | if (msg->data.result == CURLE_OK) |
569 | __FILE__, | 568 | curl_fine = 1; |
570 | __LINE__, curl_easy_strerror (msg->data.result)); | 569 | else |
571 | curl_multi_remove_handle (multi, c); | 570 | { |
572 | curl_easy_cleanup (c); | 571 | fprintf (stderr, |
573 | c = NULL; | 572 | "%s failed at %s:%d: `%s'\n", |
573 | "curl_multi_perform", | ||
574 | __FILE__, | ||
575 | __LINE__, curl_easy_strerror (msg->data.result)); | ||
576 | abort (); | ||
577 | } | ||
578 | } | ||
574 | } | 579 | } |
580 | if (! curl_fine) | ||
581 | { | ||
582 | fprintf (stderr, "libcurl haven't returned OK code\n"); | ||
583 | abort (); | ||
584 | } | ||
585 | curl_multi_remove_handle (multi, c); | ||
586 | curl_easy_cleanup (c); | ||
587 | c = NULL; | ||
588 | break; | ||
575 | } | 589 | } |
576 | /* two possibilities here; as select sets are | 590 | /* two possibilities here; as select sets are |
577 | tiny, this makes virtually no difference | 591 | tiny, this makes virtually no difference |