[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 08/335: clean up logic, simplify one dead branch in test
From: |
gnunet |
Subject: |
[libmicrohttpd] 08/335: clean up logic, simplify one dead branch in test |
Date: |
Sat, 27 Jul 2024 21:58:24 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to tag stf-m2
in repository libmicrohttpd.
commit ecc4a7acc38980401fcf60f8113cf00d2537f9f6
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sun Jan 21 10:45:19 2024 +0100
clean up logic, simplify one dead branch in test
---
src/testcurl/test_add_conn.c | 37 +++++++++++++++++++++----------------
1 file 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)
#if defined(HAVE___FUNC__)
#define externalErrorExit(ignore) \
- _externalErrorExit_func(NULL, __func__, __LINE__)
+ _externalErrorExit_func (NULL, __func__, __LINE__)
#define externalErrorExitDesc(errDesc) \
- _externalErrorExit_func(errDesc, __func__, __LINE__)
+ _externalErrorExit_func (errDesc, __func__, __LINE__)
#elif defined(HAVE___FUNCTION__)
#define externalErrorExit(ignore) \
- _externalErrorExit_func(NULL, __FUNCTION__, __LINE__)
+ _externalErrorExit_func (NULL, __FUNCTION__, __LINE__)
#define externalErrorExitDesc(errDesc) \
- _externalErrorExit_func(errDesc, __FUNCTION__, __LINE__)
+ _externalErrorExit_func (errDesc, __FUNCTION__, __LINE__)
#else
-#define externalErrorExit(ignore) _externalErrorExit_func(NULL, NULL, __LINE__)
+#define externalErrorExit(ignore) _externalErrorExit_func (NULL, NULL,
__LINE__)
#define externalErrorExitDesc(errDesc) \
- _externalErrorExit_func(errDesc, NULL, __LINE__)
+ _externalErrorExit_func (errDesc, NULL, __LINE__)
#endif
@@ -737,7 +737,9 @@ startTestMhdDaemon (enum testMhdThreadsType thrType,
*pport += 4;
}
- if (testMhdThreadExternal == thrType)
+ switch (thrType)
+ {
+ case testMhdThreadExternal:
d = MHD_start_daemon (((unsigned int) thrType) | ((unsigned int) pollType)
| MHD_USE_NO_THREAD_SAFETY
| (no_listen ? MHD_USE_NO_LISTEN_SOCKET : 0)
@@ -747,28 +749,31 @@ startTestMhdDaemon (enum testMhdThreadsType thrType,
MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL,
MHD_OPTION_APP_FD_SETSIZE, (int) FD_SETSIZE,
MHD_OPTION_END);
- else if (testMhdThreadInternalPool != thrType)
- d = MHD_start_daemon (((unsigned int) thrType) | ((unsigned int) pollType)
- | (thrType == testMhdThreadExternal ?
- 0 : MHD_USE_ITC)
+ break;
+ case testMhdThreadInternalPool:
+ d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD
+ | ((unsigned int) pollType)
+ | MHD_USE_ITC
| (no_listen ? MHD_USE_NO_LISTEN_SOCKET : 0)
| MHD_USE_ERROR_LOG,
*pport, NULL, NULL,
&ahc_echo, NULL,
+ MHD_OPTION_THREAD_POOL_SIZE,
+ testNumThreadsForPool (pollType),
MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL,
MHD_OPTION_END);
- else
- d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD
- | ((unsigned int) pollType)
+ break;
+ default:
+ d = MHD_start_daemon (((unsigned int) thrType) | ((unsigned int) pollType)
| MHD_USE_ITC
| (no_listen ? MHD_USE_NO_LISTEN_SOCKET : 0)
| MHD_USE_ERROR_LOG,
*pport, NULL, NULL,
&ahc_echo, NULL,
- MHD_OPTION_THREAD_POOL_SIZE,
- testNumThreadsForPool (pollType),
MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL,
MHD_OPTION_END);
+ break;
+ }
if (NULL == d)
{
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd] tag stf-m2 created (now 3a520997), gnunet, 2024/07/27
- [libmicrohttpd] 04/335: header work, gnunet, 2024/07/27
- [libmicrohttpd] 06/335: add missing lock, do not call 'close(-1)' on very rare error path, gnunet, 2024/07/27
- [libmicrohttpd] 05/335: small typo likely from copy&paste causing macro names to be different between builds with and without messages resulting in compilation failure if configured with --disable-messages, gnunet, 2024/07/27
- [libmicrohttpd] 08/335: clean up logic, simplify one dead branch in test,
gnunet <=
- [libmicrohttpd] 07/335: use correct HTTP header (content type, not content encoding) for mime type in example; do check return value in example, gnunet, 2024/07/27
- [libmicrohttpd] 01/335: first edits, gnunet, 2024/07/27
- [libmicrohttpd] 09/335: fix memory leak on error path, gnunet, 2024/07/27
- [libmicrohttpd] 11/335: Fixed some doxy for digest auth, gnunet, 2024/07/27
- [libmicrohttpd] 10/335: fix #8012, gnunet, 2024/07/27
- [libmicrohttpd] 03/335: checkpointing, gnunet, 2024/07/27
- [libmicrohttpd] 02/335: checkpointing, gnunet, 2024/07/27
- [libmicrohttpd] 13/335: digest_auth_example_adv: added new example, gnunet, 2024/07/27
- [libmicrohttpd] 24/335: Fixed compiler warnings, gnunet, 2024/07/27
- [libmicrohttpd] 21/335: Updated .gitignore, gnunet, 2024/07/27