commit 27d8513424e1577f33b16b598fadf303d2eac6d7
parent e379ceb7df948e09982db6b1e7a9d7b4ffb722ae
Author: Christian Grothoff <christian@grothoff.org>
Date: Sun, 4 Sep 2016 11:13:29 +0000
-run non-TLS test also for poll/epoll
Diffstat:
2 files changed, 20 insertions(+), 14 deletions(-)
diff --git a/src/microhttpd/test_upgrade.c b/src/microhttpd/test_upgrade.c
@@ -279,13 +279,13 @@ ahc_upgrade (void *cls,
static int
-test_upgrade_internal_select ()
+test_upgrade_internal (int flags)
{
struct MHD_Daemon *d;
MHD_socket sock;
struct sockaddr_in sa;
- d = MHD_start_daemon (MHD_USE_SELECT_INTERNALLY | MHD_USE_DEBUG | MHD_USE_SUSPEND_RESUME,
+ d = MHD_start_daemon (flags | MHD_USE_DEBUG | MHD_USE_SUSPEND_RESUME,
1080,
NULL, NULL,
&ahc_upgrade, NULL,
@@ -321,12 +321,18 @@ int
main (int argc,
char *const *argv)
{
- int errorCount = 0;
+ int error_count = 0;
- errorCount += test_upgrade_internal_select ();
- if (errorCount != 0)
+ error_count += test_upgrade_internal (MHD_USE_SELECT_INTERNALLY);
+#ifdef HAVE_POLL
+ error_count += test_upgrade_internal (MHD_USE_POLL_INTERNALLY);
+#endif
+#ifdef EPOLL_SUPPORT
+ error_count += test_upgrade_internal (MHD_USE_EPOLL_INTERNALLY);
+#endif
+ if (error_count != 0)
fprintf (stderr,
"Error (code: %u)\n",
- errorCount);
- return errorCount != 0; /* 0 == pass */
+ error_count);
+ return error_count != 0; /* 0 == pass */
}
diff --git a/src/microhttpd/test_upgrade_ssl.c b/src/microhttpd/test_upgrade_ssl.c
@@ -436,21 +436,21 @@ int
main (int argc,
char *const *argv)
{
- int errorCount = 0;
+ int error_count = 0;
if (0 != system ("openssl version 1> /dev/null"))
return 77; /* openssl not available, can't run the test */
- errorCount += test_upgrade_internal (MHD_USE_SELECT_INTERNALLY);
+ error_count += test_upgrade_internal (MHD_USE_SELECT_INTERNALLY);
#ifdef HAVE_POLL
- errorCount += test_upgrade_internal (MHD_USE_POLL_INTERNALLY);
+ error_count += test_upgrade_internal (MHD_USE_POLL_INTERNALLY);
#endif
#ifdef EPOLL_SUPPORT
- errorCount += test_upgrade_internal (MHD_USE_EPOLL_INTERNALLY |
+ error_count += test_upgrade_internal (MHD_USE_EPOLL_INTERNALLY |
MHD_USE_TLS_EPOLL_UPGRADE);
#endif
- if (errorCount != 0)
+ if (error_count != 0)
fprintf (stderr,
"Error (code: %u)\n",
- errorCount);
- return errorCount != 0; /* 0 == pass */
+ error_count);
+ return error_count != 0; /* 0 == pass */
}