diff options
Diffstat (limited to 'src/daemon/daemontest_large_put.c')
-rw-r--r-- | src/daemon/daemontest_large_put.c | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/src/daemon/daemontest_large_put.c b/src/daemon/daemontest_large_put.c index 2a9ad4fa..3bbf707e 100644 --- a/src/daemon/daemontest_large_put.c +++ b/src/daemon/daemontest_large_put.c | |||
@@ -96,8 +96,16 @@ ahc_echo (void *cls, | |||
96 | return MHD_NO; /* unexpected method */ | 96 | return MHD_NO; /* unexpected method */ |
97 | if ((*done) == 0) | 97 | if ((*done) == 0) |
98 | { | 98 | { |
99 | if (*upload_data_size != PUT_SIZE) | 99 | if (*upload_data_size != PUT_SIZE) |
100 | return MHD_YES; /* not yet ready */ | 100 | { |
101 | #if 0 | ||
102 | fprintf(stderr, | ||
103 | "Waiting for more data (%u/%u)...\n", | ||
104 | *upload_data_size, | ||
105 | PUT_SIZE); | ||
106 | #endif | ||
107 | return MHD_YES; /* not yet ready */ | ||
108 | } | ||
101 | if (0 == memcmp (upload_data, put_buffer, PUT_SIZE)) | 109 | if (0 == memcmp (upload_data, put_buffer, PUT_SIZE)) |
102 | { | 110 | { |
103 | *upload_data_size = 0; | 111 | *upload_data_size = 0; |
@@ -227,7 +235,13 @@ testMultithreadedPut () | |||
227 | curl_easy_cleanup (c); | 235 | curl_easy_cleanup (c); |
228 | MHD_stop_daemon (d); | 236 | MHD_stop_daemon (d); |
229 | if (cbc.pos != strlen ("/hello_world")) | 237 | if (cbc.pos != strlen ("/hello_world")) |
230 | return 64; | 238 | { |
239 | fprintf(stderr, | ||
240 | "Got invalid response `%.*s'\n", | ||
241 | cbc.pos, | ||
242 | cbc.buf); | ||
243 | return 64; | ||
244 | } | ||
231 | if (0 != strncmp ("/hello_world", cbc.buf, strlen ("/hello_world"))) | 245 | if (0 != strncmp ("/hello_world", cbc.buf, strlen ("/hello_world"))) |
232 | return 128; | 246 | return 128; |
233 | return 0; | 247 | return 0; |
@@ -260,7 +274,10 @@ testExternalPut () | |||
260 | multi = NULL; | 274 | multi = NULL; |
261 | d = MHD_start_daemon (MHD_USE_DEBUG, | 275 | d = MHD_start_daemon (MHD_USE_DEBUG, |
262 | 1082, | 276 | 1082, |
263 | NULL, NULL, &ahc_echo, &done_flag, MHD_OPTION_END); | 277 | NULL, NULL, &ahc_echo, &done_flag, |
278 | MHD_OPTION_CONNECTION_MEMORY_LIMIT, | ||
279 | PUT_SIZE * 4, | ||
280 | MHD_OPTION_END); | ||
264 | if (d == NULL) | 281 | if (d == NULL) |
265 | return 256; | 282 | return 256; |
266 | c = curl_easy_init (); | 283 | c = curl_easy_init (); |
@@ -357,9 +374,15 @@ testExternalPut () | |||
357 | } | 374 | } |
358 | MHD_stop_daemon (d); | 375 | MHD_stop_daemon (d); |
359 | if (cbc.pos != strlen ("/hello_world")) | 376 | if (cbc.pos != strlen ("/hello_world")) |
360 | return 64; | 377 | { |
378 | fprintf(stderr, | ||
379 | "Got invalid response `%.*s'\n", | ||
380 | cbc.pos, | ||
381 | cbc.buf); | ||
382 | return 8192; | ||
383 | } | ||
361 | if (0 != strncmp ("/hello_world", cbc.buf, strlen ("/hello_world"))) | 384 | if (0 != strncmp ("/hello_world", cbc.buf, strlen ("/hello_world"))) |
362 | return 128; | 385 | return 16384; |
363 | return 0; | 386 | return 0; |
364 | } | 387 | } |
365 | 388 | ||
@@ -380,7 +403,7 @@ main (int argc, char *const *argv) | |||
380 | errorCount += testInternalPut (); | 403 | errorCount += testInternalPut (); |
381 | errorCount += testMultithreadedPut (); | 404 | errorCount += testMultithreadedPut (); |
382 | } | 405 | } |
383 | errorCount += testExternalPut (); | 406 | errorCount += testExternalPut (); |
384 | free (put_buffer); | 407 | free (put_buffer); |
385 | if (errorCount != 0) | 408 | if (errorCount != 0) |
386 | fprintf (stderr, "Error (code: %u)\n", errorCount); | 409 | fprintf (stderr, "Error (code: %u)\n", errorCount); |