diff options
author | Yang Tse <yangsita@gmail.com> | 2006-10-19 22:49:33 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2006-10-19 22:49:33 +0000 |
commit | ef267ab4491a082cf7a86127ac0937ac1e0c249a (patch) | |
tree | 7eb4fd124978c3b4f62afc61c043bf5cae2a3d43 | |
parent | 4f6ed683e83fb67388067ab16dee07cfb7368fab (diff) | |
download | curl-ef267ab4491a082cf7a86127ac0937ac1e0c249a.tar.gz |
Replace tabs with spaces and Compiler warning fix.
-rw-r--r-- | tests/libtest/lib536.c | 108 |
1 files changed, 54 insertions, 54 deletions
diff --git a/tests/libtest/lib536.c b/tests/libtest/lib536.c index 53439c797..2e7874051 100644 --- a/tests/libtest/lib536.c +++ b/tests/libtest/lib536.c @@ -18,71 +18,71 @@ static CURLMcode perform(CURLM * multi); static CURLMcode perform(CURLM * multi) { - int handles, maxfd; - CURLMcode code; - fd_set fdread, fdwrite, fdexcep; - int loop; - - for (loop=40;loop>0;loop--) { - code = curl_multi_perform(multi, &handles); - if (handles <= 0) - return CURLM_OK; - - switch (code) { - case CURLM_OK: - break; - case CURLM_CALL_MULTI_PERFORM: - continue; - default: - return code; - } - - FD_ZERO(&fdread); - FD_ZERO(&fdwrite); - FD_ZERO(&fdexcep); - curl_multi_fdset(multi, &fdread, &fdwrite, &fdexcep, &maxfd); - if (maxfd < 0) - return (CURLMcode) ~CURLM_OK; - if (select(maxfd + 1, &fdread, &fdwrite, &fdexcep, 0) == -1) - return (CURLMcode) ~CURLM_OK; - } - if (loop <= 0) { - fprintf(stderr, "ABORTING TEST, since it seems " - "that it would have run forever.\n"); - return (CURLMcode) ~CURLM_OK; - } + int handles, maxfd; + CURLMcode code; + fd_set fdread, fdwrite, fdexcep; + int loop; + + for (loop=40;loop>0;loop--) { + code = curl_multi_perform(multi, &handles); + if (handles <= 0) + return CURLM_OK; + + switch (code) { + case CURLM_OK: + break; + case CURLM_CALL_MULTI_PERFORM: + continue; + default: + return code; + } + + FD_ZERO(&fdread); + FD_ZERO(&fdwrite); + FD_ZERO(&fdexcep); + curl_multi_fdset(multi, &fdread, &fdwrite, &fdexcep, &maxfd); + if (maxfd < 0) + return (CURLMcode) ~CURLM_OK; + if (select(maxfd + 1, &fdread, &fdwrite, &fdexcep, 0) == -1) + return (CURLMcode) ~CURLM_OK; + } + + /* We only reach this point if (loop <= 0) */ + fprintf(stderr, "ABORTING TEST, since it seems " + "that it would have run forever.\n"); + return (CURLMcode) ~CURLM_OK; } int test(char *URL) { - CURLM *multi = curl_multi_init(); - CURL *easy = curl_easy_init(); + CURLM *multi = curl_multi_init(); + CURL *easy = curl_easy_init(); - curl_multi_setopt(multi, CURLMOPT_PIPELINING, 1); + curl_multi_setopt(multi, CURLMOPT_PIPELINING, 1); - curl_easy_setopt(easy, CURLOPT_WRITEFUNCTION, fwrite); - curl_easy_setopt(easy, CURLOPT_FAILONERROR, 1); - curl_easy_setopt(easy, CURLOPT_URL, URL); + curl_easy_setopt(easy, CURLOPT_WRITEFUNCTION, fwrite); + curl_easy_setopt(easy, CURLOPT_FAILONERROR, 1); + curl_easy_setopt(easy, CURLOPT_URL, URL); - curl_multi_add_handle(multi, easy); - if (perform(multi) != CURLM_OK) - printf("retrieve 1 failed\n"); + curl_multi_add_handle(multi, easy); + if (perform(multi) != CURLM_OK) + printf("retrieve 1 failed\n"); - curl_multi_remove_handle(multi, easy); - curl_easy_reset(easy); + curl_multi_remove_handle(multi, easy); + curl_easy_reset(easy); - curl_easy_setopt(easy, CURLOPT_FAILONERROR, 1); - curl_easy_setopt(easy, CURLOPT_URL, arg2); + curl_easy_setopt(easy, CURLOPT_FAILONERROR, 1); + curl_easy_setopt(easy, CURLOPT_URL, arg2); - curl_multi_add_handle(multi, easy); - if (perform(multi) != CURLM_OK) - printf("retrieve 2 failed\n"); + curl_multi_add_handle(multi, easy); + if (perform(multi) != CURLM_OK) + printf("retrieve 2 failed\n"); - curl_multi_remove_handle(multi, easy); - curl_easy_cleanup(easy); - curl_multi_cleanup(multi); + curl_multi_remove_handle(multi, easy); + curl_easy_cleanup(easy); + curl_multi_cleanup(multi); - printf("Finished!\n"); + printf("Finished!\n"); - return 0; + return 0; } |