diff options
author | Christian Grothoff <christian@grothoff.org> | 2024-01-21 10:45:19 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2024-01-21 10:45:19 +0100 |
commit | 0e4d6c2f934f44886816d701eef4a7edae81dc47 (patch) | |
tree | 90c79c106e0a2e281d64c011fff95bb0095ff8f9 /src/testcurl | |
parent | 52a5e465844add3dd968f2318eab5e6f91a5a1e7 (diff) | |
download | libmicrohttpd-0e4d6c2f934f44886816d701eef4a7edae81dc47.tar.gz libmicrohttpd-0e4d6c2f934f44886816d701eef4a7edae81dc47.zip |
clean up logic, simplify one dead branch in test
Diffstat (limited to 'src/testcurl')
-rw-r--r-- | src/testcurl/test_add_conn.c | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/src/testcurl/test_add_conn.c b/src/testcurl/test_add_conn.c index 2539b5f5..503ad89e 100644 --- a/src/testcurl/test_add_conn.c +++ b/src/testcurl/test_add_conn.c | |||
@@ -239,18 +239,18 @@ _externalErrorExit_func (const char *errDesc, const char *funcName, int lineNum) | |||
239 | 239 | ||
240 | #if defined(HAVE___FUNC__) | 240 | #if defined(HAVE___FUNC__) |
241 | #define externalErrorExit(ignore) \ | 241 | #define externalErrorExit(ignore) \ |
242 | _externalErrorExit_func(NULL, __func__, __LINE__) | 242 | _externalErrorExit_func (NULL, __func__, __LINE__) |
243 | #define externalErrorExitDesc(errDesc) \ | 243 | #define externalErrorExitDesc(errDesc) \ |
244 | _externalErrorExit_func(errDesc, __func__, __LINE__) | 244 | _externalErrorExit_func (errDesc, __func__, __LINE__) |
245 | #elif defined(HAVE___FUNCTION__) | 245 | #elif defined(HAVE___FUNCTION__) |
246 | #define externalErrorExit(ignore) \ | 246 | #define externalErrorExit(ignore) \ |
247 | _externalErrorExit_func(NULL, __FUNCTION__, __LINE__) | 247 | _externalErrorExit_func (NULL, __FUNCTION__, __LINE__) |
248 | #define externalErrorExitDesc(errDesc) \ | 248 | #define externalErrorExitDesc(errDesc) \ |
249 | _externalErrorExit_func(errDesc, __FUNCTION__, __LINE__) | 249 | _externalErrorExit_func (errDesc, __FUNCTION__, __LINE__) |
250 | #else | 250 | #else |
251 | #define externalErrorExit(ignore) _externalErrorExit_func(NULL, NULL, __LINE__) | 251 | #define externalErrorExit(ignore) _externalErrorExit_func (NULL, NULL, __LINE__) |
252 | #define externalErrorExitDesc(errDesc) \ | 252 | #define externalErrorExitDesc(errDesc) \ |
253 | _externalErrorExit_func(errDesc, NULL, __LINE__) | 253 | _externalErrorExit_func (errDesc, NULL, __LINE__) |
254 | #endif | 254 | #endif |
255 | 255 | ||
256 | 256 | ||
@@ -737,7 +737,9 @@ startTestMhdDaemon (enum testMhdThreadsType thrType, | |||
737 | *pport += 4; | 737 | *pport += 4; |
738 | } | 738 | } |
739 | 739 | ||
740 | if (testMhdThreadExternal == thrType) | 740 | switch (thrType) |
741 | { | ||
742 | case testMhdThreadExternal: | ||
741 | d = MHD_start_daemon (((unsigned int) thrType) | ((unsigned int) pollType) | 743 | d = MHD_start_daemon (((unsigned int) thrType) | ((unsigned int) pollType) |
742 | | MHD_USE_NO_THREAD_SAFETY | 744 | | MHD_USE_NO_THREAD_SAFETY |
743 | | (no_listen ? MHD_USE_NO_LISTEN_SOCKET : 0) | 745 | | (no_listen ? MHD_USE_NO_LISTEN_SOCKET : 0) |
@@ -747,28 +749,31 @@ startTestMhdDaemon (enum testMhdThreadsType thrType, | |||
747 | MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, | 749 | MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, |
748 | MHD_OPTION_APP_FD_SETSIZE, (int) FD_SETSIZE, | 750 | MHD_OPTION_APP_FD_SETSIZE, (int) FD_SETSIZE, |
749 | MHD_OPTION_END); | 751 | MHD_OPTION_END); |
750 | else if (testMhdThreadInternalPool != thrType) | 752 | break; |
751 | d = MHD_start_daemon (((unsigned int) thrType) | ((unsigned int) pollType) | 753 | case testMhdThreadInternalPool: |
752 | | (thrType == testMhdThreadExternal ? | 754 | d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD |
753 | 0 : MHD_USE_ITC) | 755 | | ((unsigned int) pollType) |
756 | | MHD_USE_ITC | ||
754 | | (no_listen ? MHD_USE_NO_LISTEN_SOCKET : 0) | 757 | | (no_listen ? MHD_USE_NO_LISTEN_SOCKET : 0) |
755 | | MHD_USE_ERROR_LOG, | 758 | | MHD_USE_ERROR_LOG, |
756 | *pport, NULL, NULL, | 759 | *pport, NULL, NULL, |
757 | &ahc_echo, NULL, | 760 | &ahc_echo, NULL, |
761 | MHD_OPTION_THREAD_POOL_SIZE, | ||
762 | testNumThreadsForPool (pollType), | ||
758 | MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, | 763 | MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, |
759 | MHD_OPTION_END); | 764 | MHD_OPTION_END); |
760 | else | 765 | break; |
761 | d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | 766 | default: |
762 | | ((unsigned int) pollType) | 767 | d = MHD_start_daemon (((unsigned int) thrType) | ((unsigned int) pollType) |
763 | | MHD_USE_ITC | 768 | | MHD_USE_ITC |
764 | | (no_listen ? MHD_USE_NO_LISTEN_SOCKET : 0) | 769 | | (no_listen ? MHD_USE_NO_LISTEN_SOCKET : 0) |
765 | | MHD_USE_ERROR_LOG, | 770 | | MHD_USE_ERROR_LOG, |
766 | *pport, NULL, NULL, | 771 | *pport, NULL, NULL, |
767 | &ahc_echo, NULL, | 772 | &ahc_echo, NULL, |
768 | MHD_OPTION_THREAD_POOL_SIZE, | ||
769 | testNumThreadsForPool (pollType), | ||
770 | MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, | 773 | MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, |
771 | MHD_OPTION_END); | 774 | MHD_OPTION_END); |
775 | break; | ||
776 | } | ||
772 | 777 | ||
773 | if (NULL == d) | 778 | if (NULL == d) |
774 | { | 779 | { |