summaryrefslogtreecommitdiff
path: root/tests/libtest/lib556.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/libtest/lib556.c')
-rw-r--r--tests/libtest/lib556.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/tests/libtest/lib556.c b/tests/libtest/lib556.c
index f06c5299c..527935396 100644
--- a/tests/libtest/lib556.c
+++ b/tests/libtest/lib556.c
@@ -45,8 +45,7 @@ int test(char *URL)
return TEST_ERR_MAJOR_BAD;
}
- curl = curl_easy_init();
- if(!curl) {
+ if((curl = curl_easy_init()) == NULL) {
fprintf(stderr, "curl_easy_init() failed\n");
curl_global_cleanup();
return TEST_ERR_MAJOR_BAD;
@@ -77,10 +76,11 @@ int test(char *URL)
if(!res) {
/* we assume that sending always work */
+ size_t total=0;
do {
/* busy-read like crazy */
- res = curl_easy_recv(curl, buf, sizeof(buf), &iolen);
+ res = curl_easy_recv(curl, buf, 1024, &iolen);
#ifdef TPF
sleep(1); /* avoid ctl-10 dump */
@@ -91,12 +91,10 @@ int test(char *URL)
if(!write(STDOUT_FILENO, buf, iolen))
break;
}
+ total += iolen;
- } while((res == CURLE_OK && iolen != 0) || (res == CURLE_AGAIN));
+ } while(((res == CURLE_OK) || (res == CURLE_AGAIN)) && (total < 129));
}
-
- if(res != CURLE_OK || iolen != 0)
- return TEST_ERR_FAILURE;
}
test_cleanup: