libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit 6f3759be399e9a6cb32f83c82db2a0f45b42b8fe
parent 27d8513424e1577f33b16b598fadf303d2eac6d7
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sun,  4 Sep 2016 11:16:38 +0000

-run tests with/without thread pool

Diffstat:
Msrc/microhttpd/test_upgrade.c | 19+++++++++++++++----
Msrc/microhttpd/test_upgrade_ssl.c | 20++++++++++++++++----
2 files changed, 31 insertions(+), 8 deletions(-)

diff --git a/src/microhttpd/test_upgrade.c b/src/microhttpd/test_upgrade.c @@ -279,7 +279,8 @@ ahc_upgrade (void *cls, static int -test_upgrade_internal (int flags) +test_upgrade_internal (int flags, + unsigned int pool) { struct MHD_Daemon *d; MHD_socket sock; @@ -289,6 +290,7 @@ test_upgrade_internal (int flags) 1080, NULL, NULL, &ahc_upgrade, NULL, + MHD_OPTION_THREAD_POOL_SIZE, pool, MHD_OPTION_END); if (NULL == d) return 2; @@ -323,12 +325,21 @@ main (int argc, { int error_count = 0; - error_count += test_upgrade_internal (MHD_USE_SELECT_INTERNALLY); + error_count += test_upgrade_internal (MHD_USE_SELECT_INTERNALLY, + 1); + error_count += test_upgrade_internal (MHD_USE_SELECT_INTERNALLY, + 2); #ifdef HAVE_POLL - error_count += test_upgrade_internal (MHD_USE_POLL_INTERNALLY); + error_count += test_upgrade_internal (MHD_USE_POLL_INTERNALLY, + 1); + error_count += test_upgrade_internal (MHD_USE_POLL_INTERNALLY, + 2); #endif #ifdef EPOLL_SUPPORT - error_count += test_upgrade_internal (MHD_USE_EPOLL_INTERNALLY); + error_count += test_upgrade_internal (MHD_USE_EPOLL_INTERNALLY, + 1); + error_count += test_upgrade_internal (MHD_USE_EPOLL_INTERNALLY, + 2); #endif if (error_count != 0) fprintf (stderr, diff --git a/src/microhttpd/test_upgrade_ssl.c b/src/microhttpd/test_upgrade_ssl.c @@ -393,7 +393,8 @@ ahc_upgrade (void *cls, static int -test_upgrade_internal (int flags) +test_upgrade_internal (int flags, + unsigned int pool) { struct MHD_Daemon *d; MHD_socket sock; @@ -405,6 +406,7 @@ test_upgrade_internal (int flags) &ahc_upgrade, NULL, MHD_OPTION_HTTPS_MEM_KEY, srv_signed_key_pem, MHD_OPTION_HTTPS_MEM_CERT, srv_signed_cert_pem, + MHD_OPTION_THREAD_POOL_SIZE, pool, MHD_OPTION_END); if (NULL == d) return 2; @@ -440,13 +442,23 @@ main (int argc, if (0 != system ("openssl version 1> /dev/null")) return 77; /* openssl not available, can't run the test */ - error_count += test_upgrade_internal (MHD_USE_SELECT_INTERNALLY); + error_count += test_upgrade_internal (MHD_USE_SELECT_INTERNALLY, + 1); + error_count += test_upgrade_internal (MHD_USE_SELECT_INTERNALLY, + 2); #ifdef HAVE_POLL - error_count += test_upgrade_internal (MHD_USE_POLL_INTERNALLY); + error_count += test_upgrade_internal (MHD_USE_POLL_INTERNALLY, + 1); + error_count += test_upgrade_internal (MHD_USE_POLL_INTERNALLY, + 2); #endif #ifdef EPOLL_SUPPORT error_count += test_upgrade_internal (MHD_USE_EPOLL_INTERNALLY | - MHD_USE_TLS_EPOLL_UPGRADE); + MHD_USE_TLS_EPOLL_UPGRADE, + 1); + error_count += test_upgrade_internal (MHD_USE_EPOLL_INTERNALLY | + MHD_USE_TLS_EPOLL_UPGRADE, + 2); #endif if (error_count != 0) fprintf (stderr,