diff options
Diffstat (limited to 'src/testcurl/test_get_chunked.c')
-rw-r--r-- | src/testcurl/test_get_chunked.c | 47 |
1 files changed, 30 insertions, 17 deletions
diff --git a/src/testcurl/test_get_chunked.c b/src/testcurl/test_get_chunked.c index eeb4228c..b4644e5b 100644 --- a/src/testcurl/test_get_chunked.c +++ b/src/testcurl/test_get_chunked.c | |||
@@ -686,26 +686,39 @@ testExternalGet () | |||
686 | #endif | 686 | #endif |
687 | } | 687 | } |
688 | curl_multi_perform (multi, &running); | 688 | curl_multi_perform (multi, &running); |
689 | if (running == 0) | 689 | if (0 == running) |
690 | { | 690 | { |
691 | msg = curl_multi_info_read (multi, &running); | 691 | int pending; |
692 | if (msg == NULL) | 692 | int curl_fine = 0; |
693 | break; | 693 | while (NULL != (msg = curl_multi_info_read (multi, &pending))) |
694 | if (msg->msg == CURLMSG_DONE) | ||
695 | { | 694 | { |
696 | if (msg->data.result != CURLE_OK) | 695 | if (msg->msg == CURLMSG_DONE) |
697 | printf ("%s failed at %s:%d: `%s'\n", | 696 | { |
698 | "curl_multi_perform", | 697 | if (msg->data.result == CURLE_OK) |
699 | __FILE__, | 698 | curl_fine = 1; |
700 | __LINE__, curl_easy_strerror (msg->data.result)); | 699 | else |
701 | curl_multi_remove_handle (multi, c); | 700 | { |
702 | curl_multi_cleanup (multi); | 701 | fprintf (stderr, |
703 | curl_easy_cleanup (c); | 702 | "%s failed at %s:%d: `%s'\n", |
704 | curl_slist_free_all (h_list); | 703 | "curl_multi_perform", |
705 | h_list = NULL; | 704 | __FILE__, |
706 | c = NULL; | 705 | __LINE__, curl_easy_strerror (msg->data.result)); |
707 | multi = NULL; | 706 | abort (); |
707 | } | ||
708 | } | ||
708 | } | 709 | } |
710 | if (! curl_fine) | ||
711 | { | ||
712 | fprintf (stderr, "libcurl haven't returned OK code\n"); | ||
713 | abort (); | ||
714 | } | ||
715 | curl_multi_remove_handle (multi, c); | ||
716 | curl_multi_cleanup (multi); | ||
717 | curl_easy_cleanup (c); | ||
718 | curl_slist_free_all (h_list); | ||
719 | h_list = NULL; | ||
720 | c = NULL; | ||
721 | multi = NULL; | ||
709 | } | 722 | } |
710 | MHD_run (d); | 723 | MHD_run (d); |
711 | } | 724 | } |