summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Kaufmann <mail@michael-kaufmann.ch>2016-12-18 12:51:48 +0100
committerMichael Kaufmann <mail@michael-kaufmann.ch>2016-12-18 12:56:23 +0100
commitafff64dbcde9cf45956f5557a8270b21c0e93dd5 (patch)
treefb610f970b9bf214d46877d8fb7555653eaca216 /tests
parent82245eaa56c368f6b6b9abf4de63e7d6fb786f71 (diff)
downloadcurl-afff64dbcde9cf45956f5557a8270b21c0e93dd5.tar.gz
curl_easy_recv: Improve documentation and example program
Follow-up to 82245ea: Fix the example program sendrecv.c (handle CURLE_AGAIN, handle incomplete send). Improve the documentation for curl_easy_recv() and curl_easy_send(). Reviewed-by: Frank Meier Assisted-by: Jay Satiro See https://github.com/curl/curl/pull/1134
Diffstat (limited to 'tests')
-rw-r--r--tests/data/test5562
-rw-r--r--tests/libtest/lib556.c9
2 files changed, 6 insertions, 5 deletions
diff --git a/tests/data/test556 b/tests/data/test556
index 55c7c91c3..549b9a4a2 100644
--- a/tests/data/test556
+++ b/tests/data/test556
@@ -8,7 +8,7 @@ HTTP GET
<reply>
<data>
-HTTP/1.1 200 OK
+HTTP/1.1 200 OK swsclose
Server: test-server/fake
Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
Content-Length: 6
diff --git a/tests/libtest/lib556.c b/tests/libtest/lib556.c
index a26101940..f06c5299c 100644
--- a/tests/libtest/lib556.c
+++ b/tests/libtest/lib556.c
@@ -77,11 +77,10 @@ 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, 1024, &iolen);
+ res = curl_easy_recv(curl, buf, sizeof(buf), &iolen);
#ifdef TPF
sleep(1); /* avoid ctl-10 dump */
@@ -92,10 +91,12 @@ int test(char *URL)
if(!write(STDOUT_FILENO, buf, iolen))
break;
}
- total += iolen;
- } while(((res == CURLE_OK) || (res == CURLE_AGAIN)) && (total < 129));
+ } while((res == CURLE_OK && iolen != 0) || (res == CURLE_AGAIN));
}
+
+ if(res != CURLE_OK || iolen != 0)
+ return TEST_ERR_FAILURE;
}
test_cleanup: