aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/daemontest_put_chunked.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/daemon/daemontest_put_chunked.c')
-rw-r--r--src/daemon/daemontest_put_chunked.c38
1 files changed, 18 insertions, 20 deletions
diff --git a/src/daemon/daemontest_put_chunked.c b/src/daemon/daemontest_put_chunked.c
index 2abe4bd2..e4f9aa16 100644
--- a/src/daemon/daemontest_put_chunked.c
+++ b/src/daemon/daemontest_put_chunked.c
@@ -53,7 +53,7 @@ putBuffer (void *stream, size_t size, size_t nmemb, void *ptr)
53 if (wrt > 8 - (*pos)) 53 if (wrt > 8 - (*pos))
54 wrt = 8 - (*pos); 54 wrt = 8 - (*pos);
55 if (wrt > 4) 55 if (wrt > 4)
56 wrt = 4; /* only send half at first => force multiple chunks! */ 56 wrt = 4; /* only send half at first => force multiple chunks! */
57 memcpy (stream, &("Hello123"[*pos]), wrt); 57 memcpy (stream, &("Hello123"[*pos]), wrt);
58 (*pos) += wrt; 58 (*pos) += wrt;
59 return wrt; 59 return wrt;
@@ -91,19 +91,17 @@ ahc_echo (void *cls,
91 { 91 {
92 have = *upload_data_size; 92 have = *upload_data_size;
93 if (have + *done > 8) 93 if (have + *done > 8)
94 { 94 {
95 printf ("Invalid upload data `%8s'!\n", upload_data); 95 printf ("Invalid upload data `%8s'!\n", upload_data);
96 return MHD_NO; 96 return MHD_NO;
97 } 97 }
98 if (0 == memcmp(upload_data, 98 if (0 == memcmp (upload_data, &"Hello123"[*done], have))
99 &"Hello123"[*done], 99 {
100 have)) 100 *done += have;
101 { 101 *upload_data_size = 0;
102 *done += have; 102 }
103 *upload_data_size = 0;
104 }
105 else 103 else
106 { 104 {
107 printf ("Invalid upload data `%8s'!\n", upload_data); 105 printf ("Invalid upload data `%8s'!\n", upload_data);
108 return MHD_NO; 106 return MHD_NO;
109 } 107 }
@@ -144,9 +142,9 @@ testInternalPut ()
144 curl_easy_setopt (c, CURLOPT_READDATA, &pos); 142 curl_easy_setopt (c, CURLOPT_READDATA, &pos);
145 curl_easy_setopt (c, CURLOPT_UPLOAD, 1L); 143 curl_easy_setopt (c, CURLOPT_UPLOAD, 1L);
146 /* 144 /*
147 // by not giving the file size, we force chunking! 145 // by not giving the file size, we force chunking!
148 curl_easy_setopt (c, CURLOPT_INFILESIZE_LARGE, (curl_off_t) 8L); 146 curl_easy_setopt (c, CURLOPT_INFILESIZE_LARGE, (curl_off_t) 8L);
149 */ 147 */
150 curl_easy_setopt (c, CURLOPT_FAILONERROR, 1); 148 curl_easy_setopt (c, CURLOPT_FAILONERROR, 1);
151 curl_easy_setopt (c, CURLOPT_TIMEOUT, 15L); 149 curl_easy_setopt (c, CURLOPT_TIMEOUT, 15L);
152 curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); 150 curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
@@ -200,9 +198,9 @@ testMultithreadedPut ()
200 curl_easy_setopt (c, CURLOPT_READDATA, &pos); 198 curl_easy_setopt (c, CURLOPT_READDATA, &pos);
201 curl_easy_setopt (c, CURLOPT_UPLOAD, 1L); 199 curl_easy_setopt (c, CURLOPT_UPLOAD, 1L);
202 /* 200 /*
203 // by not giving the file size, we force chunking! 201 // by not giving the file size, we force chunking!
204 curl_easy_setopt (c, CURLOPT_INFILESIZE_LARGE, (curl_off_t) 8L); 202 curl_easy_setopt (c, CURLOPT_INFILESIZE_LARGE, (curl_off_t) 8L);
205 */ 203 */
206 curl_easy_setopt (c, CURLOPT_FAILONERROR, 1); 204 curl_easy_setopt (c, CURLOPT_FAILONERROR, 1);
207 curl_easy_setopt (c, CURLOPT_TIMEOUT, 15L); 205 curl_easy_setopt (c, CURLOPT_TIMEOUT, 15L);
208 curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); 206 curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
@@ -268,9 +266,9 @@ testExternalPut ()
268 curl_easy_setopt (c, CURLOPT_READDATA, &pos); 266 curl_easy_setopt (c, CURLOPT_READDATA, &pos);
269 curl_easy_setopt (c, CURLOPT_UPLOAD, 1L); 267 curl_easy_setopt (c, CURLOPT_UPLOAD, 1L);
270 /* 268 /*
271 // by not giving the file size, we force chunking! 269 // by not giving the file size, we force chunking!
272 curl_easy_setopt (c, CURLOPT_INFILESIZE_LARGE, (curl_off_t) 8L); 270 curl_easy_setopt (c, CURLOPT_INFILESIZE_LARGE, (curl_off_t) 8L);
273 */ 271 */
274 curl_easy_setopt (c, CURLOPT_FAILONERROR, 1); 272 curl_easy_setopt (c, CURLOPT_FAILONERROR, 1);
275 curl_easy_setopt (c, CURLOPT_TIMEOUT, 15L); 273 curl_easy_setopt (c, CURLOPT_TIMEOUT, 15L);
276 curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); 274 curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);