aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-09-04 11:13:29 +0000
committerChristian Grothoff <christian@grothoff.org>2016-09-04 11:13:29 +0000
commit27d8513424e1577f33b16b598fadf303d2eac6d7 (patch)
tree8a07fb6926ecd764c55ed2216efa03367be0d209
parente379ceb7df948e09982db6b1e7a9d7b4ffb722ae (diff)
downloadlibmicrohttpd-27d8513424e1577f33b16b598fadf303d2eac6d7.tar.gz
libmicrohttpd-27d8513424e1577f33b16b598fadf303d2eac6d7.zip
-run non-TLS test also for poll/epoll
-rw-r--r--src/microhttpd/test_upgrade.c20
-rw-r--r--src/microhttpd/test_upgrade_ssl.c14
2 files changed, 20 insertions, 14 deletions
diff --git a/src/microhttpd/test_upgrade.c b/src/microhttpd/test_upgrade.c
index 469dc581..8de4c832 100644
--- a/src/microhttpd/test_upgrade.c
+++ b/src/microhttpd/test_upgrade.c
@@ -279,13 +279,13 @@ ahc_upgrade (void *cls,
279 279
280 280
281static int 281static int
282test_upgrade_internal_select () 282test_upgrade_internal (int flags)
283{ 283{
284 struct MHD_Daemon *d; 284 struct MHD_Daemon *d;
285 MHD_socket sock; 285 MHD_socket sock;
286 struct sockaddr_in sa; 286 struct sockaddr_in sa;
287 287
288 d = MHD_start_daemon (MHD_USE_SELECT_INTERNALLY | MHD_USE_DEBUG | MHD_USE_SUSPEND_RESUME, 288 d = MHD_start_daemon (flags | MHD_USE_DEBUG | MHD_USE_SUSPEND_RESUME,
289 1080, 289 1080,
290 NULL, NULL, 290 NULL, NULL,
291 &ahc_upgrade, NULL, 291 &ahc_upgrade, NULL,
@@ -321,12 +321,18 @@ int
321main (int argc, 321main (int argc,
322 char *const *argv) 322 char *const *argv)
323{ 323{
324 int errorCount = 0; 324 int error_count = 0;
325 325
326 errorCount += test_upgrade_internal_select (); 326 error_count += test_upgrade_internal (MHD_USE_SELECT_INTERNALLY);
327 if (errorCount != 0) 327#ifdef HAVE_POLL
328 error_count += test_upgrade_internal (MHD_USE_POLL_INTERNALLY);
329#endif
330#ifdef EPOLL_SUPPORT
331 error_count += test_upgrade_internal (MHD_USE_EPOLL_INTERNALLY);
332#endif
333 if (error_count != 0)
328 fprintf (stderr, 334 fprintf (stderr,
329 "Error (code: %u)\n", 335 "Error (code: %u)\n",
330 errorCount); 336 error_count);
331 return errorCount != 0; /* 0 == pass */ 337 return error_count != 0; /* 0 == pass */
332} 338}
diff --git a/src/microhttpd/test_upgrade_ssl.c b/src/microhttpd/test_upgrade_ssl.c
index ad5b40c5..dd70a01d 100644
--- a/src/microhttpd/test_upgrade_ssl.c
+++ b/src/microhttpd/test_upgrade_ssl.c
@@ -436,21 +436,21 @@ int
436main (int argc, 436main (int argc,
437 char *const *argv) 437 char *const *argv)
438{ 438{
439 int errorCount = 0; 439 int error_count = 0;
440 440
441 if (0 != system ("openssl version 1> /dev/null")) 441 if (0 != system ("openssl version 1> /dev/null"))
442 return 77; /* openssl not available, can't run the test */ 442 return 77; /* openssl not available, can't run the test */
443 errorCount += test_upgrade_internal (MHD_USE_SELECT_INTERNALLY); 443 error_count += test_upgrade_internal (MHD_USE_SELECT_INTERNALLY);
444#ifdef HAVE_POLL 444#ifdef HAVE_POLL
445 errorCount += test_upgrade_internal (MHD_USE_POLL_INTERNALLY); 445 error_count += test_upgrade_internal (MHD_USE_POLL_INTERNALLY);
446#endif 446#endif
447#ifdef EPOLL_SUPPORT 447#ifdef EPOLL_SUPPORT
448 errorCount += test_upgrade_internal (MHD_USE_EPOLL_INTERNALLY | 448 error_count += test_upgrade_internal (MHD_USE_EPOLL_INTERNALLY |
449 MHD_USE_TLS_EPOLL_UPGRADE); 449 MHD_USE_TLS_EPOLL_UPGRADE);
450#endif 450#endif
451 if (errorCount != 0) 451 if (error_count != 0)
452 fprintf (stderr, 452 fprintf (stderr,
453 "Error (code: %u)\n", 453 "Error (code: %u)\n",
454 errorCount); 454 error_count);
455 return errorCount != 0; /* 0 == pass */ 455 return error_count != 0; /* 0 == pass */
456} 456}