aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/daemontest_large_put.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/daemon/daemontest_large_put.c')
-rw-r--r--src/daemon/daemontest_large_put.c34
1 files changed, 13 insertions, 21 deletions
diff --git a/src/daemon/daemontest_large_put.c b/src/daemon/daemontest_large_put.c
index 3bbf707e..b0c7bf37 100644
--- a/src/daemon/daemontest_large_put.c
+++ b/src/daemon/daemontest_large_put.c
@@ -96,16 +96,15 @@ 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 { 100 {
101#if 0 101#if 0
102 fprintf(stderr, 102 fprintf (stderr,
103 "Waiting for more data (%u/%u)...\n", 103 "Waiting for more data (%u/%u)...\n",
104 *upload_data_size, 104 *upload_data_size, PUT_SIZE);
105 PUT_SIZE);
106#endif 105#endif
107 return MHD_YES; /* not yet ready */ 106 return MHD_YES; /* not yet ready */
108 } 107 }
109 if (0 == memcmp (upload_data, put_buffer, PUT_SIZE)) 108 if (0 == memcmp (upload_data, put_buffer, PUT_SIZE))
110 { 109 {
111 *upload_data_size = 0; 110 *upload_data_size = 0;
@@ -236,10 +235,7 @@ testMultithreadedPut ()
236 MHD_stop_daemon (d); 235 MHD_stop_daemon (d);
237 if (cbc.pos != strlen ("/hello_world")) 236 if (cbc.pos != strlen ("/hello_world"))
238 { 237 {
239 fprintf(stderr, 238 fprintf (stderr, "Got invalid response `%.*s'\n", cbc.pos, cbc.buf);
240 "Got invalid response `%.*s'\n",
241 cbc.pos,
242 cbc.buf);
243 return 64; 239 return 64;
244 } 240 }
245 if (0 != strncmp ("/hello_world", cbc.buf, strlen ("/hello_world"))) 241 if (0 != strncmp ("/hello_world", cbc.buf, strlen ("/hello_world")))
@@ -274,10 +270,9 @@ testExternalPut ()
274 multi = NULL; 270 multi = NULL;
275 d = MHD_start_daemon (MHD_USE_DEBUG, 271 d = MHD_start_daemon (MHD_USE_DEBUG,
276 1082, 272 1082,
277 NULL, NULL, &ahc_echo, &done_flag, 273 NULL, NULL, &ahc_echo, &done_flag,
278 MHD_OPTION_CONNECTION_MEMORY_LIMIT, 274 MHD_OPTION_CONNECTION_MEMORY_LIMIT,
279 PUT_SIZE * 4, 275 PUT_SIZE * 4, MHD_OPTION_END);
280 MHD_OPTION_END);
281 if (d == NULL) 276 if (d == NULL)
282 return 256; 277 return 256;
283 c = curl_easy_init (); 278 c = curl_easy_init ();
@@ -375,10 +370,7 @@ testExternalPut ()
375 MHD_stop_daemon (d); 370 MHD_stop_daemon (d);
376 if (cbc.pos != strlen ("/hello_world")) 371 if (cbc.pos != strlen ("/hello_world"))
377 { 372 {
378 fprintf(stderr, 373 fprintf (stderr, "Got invalid response `%.*s'\n", cbc.pos, cbc.buf);
379 "Got invalid response `%.*s'\n",
380 cbc.pos,
381 cbc.buf);
382 return 8192; 374 return 8192;
383 } 375 }
384 if (0 != strncmp ("/hello_world", cbc.buf, strlen ("/hello_world"))) 376 if (0 != strncmp ("/hello_world", cbc.buf, strlen ("/hello_world")))
@@ -403,7 +395,7 @@ main (int argc, char *const *argv)
403 errorCount += testInternalPut (); 395 errorCount += testInternalPut ();
404 errorCount += testMultithreadedPut (); 396 errorCount += testMultithreadedPut ();
405 } 397 }
406 errorCount += testExternalPut (); 398 errorCount += testExternalPut ();
407 free (put_buffer); 399 free (put_buffer);
408 if (errorCount != 0) 400 if (errorCount != 0)
409 fprintf (stderr, "Error (code: %u)\n", errorCount); 401 fprintf (stderr, "Error (code: %u)\n", errorCount);