aboutsummaryrefslogtreecommitdiff
path: root/src/testcurl/test_put.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-10-31 13:06:08 +0100
committerChristian Grothoff <christian@grothoff.org>2019-10-31 13:06:08 +0100
commit7389c3452884ad29faf5a2d6856aebd364ffae6b (patch)
tree71246e22c8513c0dcbf79b837cb9c084c29e434c /src/testcurl/test_put.c
parente0a076284525eaf2ec4cb356a40cccc25e24f2b1 (diff)
downloadlibmicrohttpd-7389c3452884ad29faf5a2d6856aebd364ffae6b.tar.gz
libmicrohttpd-7389c3452884ad29faf5a2d6856aebd364ffae6b.zip
tighten formatting rules
Diffstat (limited to 'src/testcurl/test_put.c')
-rw-r--r--src/testcurl/test_put.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/testcurl/test_put.c b/src/testcurl/test_put.c
index df399268..2326310a 100644
--- a/src/testcurl/test_put.c
+++ b/src/testcurl/test_put.c
@@ -67,6 +67,7 @@ putBuffer (void *stream, size_t size, size_t nmemb, void *ptr)
67 return wrt; 67 return wrt;
68} 68}
69 69
70
70static size_t 71static size_t
71copyBuffer (void *ptr, size_t size, size_t nmemb, void *ctx) 72copyBuffer (void *ptr, size_t size, size_t nmemb, void *ctx)
72{ 73{
@@ -79,6 +80,7 @@ copyBuffer (void *ptr, size_t size, size_t nmemb, void *ctx)
79 return size * nmemb; 80 return size * nmemb;
80} 81}
81 82
83
82static int 84static int
83ahc_echo (void *cls, 85ahc_echo (void *cls,
84 struct MHD_Connection *connection, 86 struct MHD_Connection *connection,
@@ -152,7 +154,7 @@ testInternalPut ()
152 { 154 {
153 const union MHD_DaemonInfo *dinfo; 155 const union MHD_DaemonInfo *dinfo;
154 dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT); 156 dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
155 if ((NULL == dinfo) ||(0 == dinfo->port) ) 157 if ((NULL == dinfo) || (0 == dinfo->port) )
156 { 158 {
157 MHD_stop_daemon (d); return 32; 159 MHD_stop_daemon (d); return 32;
158 } 160 }
@@ -196,6 +198,7 @@ testInternalPut ()
196 return 0; 198 return 0;
197} 199}
198 200
201
199static int 202static int
200testMultithreadedPut () 203testMultithreadedPut ()
201{ 204{
@@ -230,7 +233,7 @@ testMultithreadedPut ()
230 { 233 {
231 const union MHD_DaemonInfo *dinfo; 234 const union MHD_DaemonInfo *dinfo;
232 dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT); 235 dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
233 if ((NULL == dinfo) ||(0 == dinfo->port) ) 236 if ((NULL == dinfo) || (0 == dinfo->port) )
234 { 237 {
235 MHD_stop_daemon (d); return 32; 238 MHD_stop_daemon (d); return 32;
236 } 239 }
@@ -275,6 +278,7 @@ testMultithreadedPut ()
275 return 0; 278 return 0;
276} 279}
277 280
281
278static int 282static int
279testMultithreadedPoolPut () 283testMultithreadedPoolPut ()
280{ 284{
@@ -309,7 +313,7 @@ testMultithreadedPoolPut ()
309 { 313 {
310 const union MHD_DaemonInfo *dinfo; 314 const union MHD_DaemonInfo *dinfo;
311 dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT); 315 dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
312 if ((NULL == dinfo) ||(0 == dinfo->port) ) 316 if ((NULL == dinfo) || (0 == dinfo->port) )
313 { 317 {
314 MHD_stop_daemon (d); return 32; 318 MHD_stop_daemon (d); return 32;
315 } 319 }
@@ -399,7 +403,7 @@ testExternalPut ()
399 { 403 {
400 const union MHD_DaemonInfo *dinfo; 404 const union MHD_DaemonInfo *dinfo;
401 dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT); 405 dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
402 if ((NULL == dinfo) ||(0 == dinfo->port) ) 406 if ((NULL == dinfo) || (0 == dinfo->port) )
403 { 407 {
404 MHD_stop_daemon (d); return 32; 408 MHD_stop_daemon (d); return 32;
405 } 409 }
@@ -480,9 +484,10 @@ testExternalPut ()
480 if (EINTR != errno) 484 if (EINTR != errno)
481 abort (); 485 abort ();
482#else 486#else
483 if ((WSAEINVAL != WSAGetLastError ()) ||(0 != rs.fd_count) ||(0 != 487 if ((WSAEINVAL != WSAGetLastError ()) || (0 != rs.fd_count) || (0 !=
484 ws.fd_count) 488 ws.
485 ||(0 != es.fd_count) ) 489 fd_count)
490 || (0 != es.fd_count) )
486 _exit (99); 491 _exit (99);
487 Sleep (1000); 492 Sleep (1000);
488#endif 493#endif
@@ -524,14 +529,13 @@ testExternalPut ()
524} 529}
525 530
526 531
527
528int 532int
529main (int argc, char *const *argv) 533main (int argc, char *const *argv)
530{ 534{
531 unsigned int errorCount = 0; 535 unsigned int errorCount = 0;
532 (void) argc; /* Unused. Silent compiler warning. */ 536 (void) argc; /* Unused. Silent compiler warning. */
533 537
534 if ((NULL == argv)||(0 == argv[0])) 538 if ((NULL == argv) || (0 == argv[0]))
535 return 99; 539 return 99;
536 oneone = has_in_name (argv[0], "11"); 540 oneone = has_in_name (argv[0], "11");
537 if (0 != curl_global_init (CURL_GLOBAL_WIN32)) 541 if (0 != curl_global_init (CURL_GLOBAL_WIN32))