aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-02-14 18:00:17 +0100
committerChristian Grothoff <christian@grothoff.org>2017-02-14 18:00:17 +0100
commit3ba8a0c8b988289b512f88d60ccaaea7f52b472a (patch)
treec6c954070c4087df3ed53ba7a62e23a229a90d8b
parent8a84902f7447edd6f677dfa9983c16146dacc7c5 (diff)
downloadlibmicrohttpd-3ba8a0c8b988289b512f88d60ccaaea7f52b472a.tar.gz
libmicrohttpd-3ba8a0c8b988289b512f88d60ccaaea7f52b472a.zip
convert 'thread_joined' to bool
-rw-r--r--src/microhttpd/daemon.c8
-rw-r--r--src/microhttpd/internal.h4
-rw-r--r--src/testcurl/https/test_https_get.c2
3 files changed, 7 insertions, 7 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index fda7f51b..5ac7c341 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -2788,7 +2788,7 @@ MHD_cleanup_connections (struct MHD_Daemon *daemon)
2788 MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex); 2788 MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
2789 2789
2790 if ( (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) && 2790 if ( (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) &&
2791 (MHD_NO == pos->thread_joined) && 2791 (! pos->thread_joined) &&
2792 (! MHD_join_thread_ (pos->pid)) ) 2792 (! MHD_join_thread_ (pos->pid)) )
2793 MHD_PANIC (_("Failed to join a thread\n")); 2793 MHD_PANIC (_("Failed to join a thread\n"));
2794#ifdef UPGRADE_SUPPORT 2794#ifdef UPGRADE_SUPPORT
@@ -5658,11 +5658,11 @@ close_all_connections (struct MHD_Daemon *daemon)
5658 pos = daemon->connections_head; 5658 pos = daemon->connections_head;
5659 while (NULL != pos) 5659 while (NULL != pos)
5660 { 5660 {
5661 if (MHD_YES != pos->thread_joined) 5661 if (! pos->thread_joined)
5662 { 5662 {
5663 if (! MHD_join_thread_ (pos->pid)) 5663 if (! MHD_join_thread_ (pos->pid))
5664 MHD_PANIC (_("Failed to join a thread\n")); 5664 MHD_PANIC (_("Failed to join a thread\n"));
5665 pos->thread_joined = MHD_YES; 5665 pos->thread_joined = true;
5666 /* The thread may have concurrently modified the DLL, 5666 /* The thread may have concurrently modified the DLL,
5667 need to restart from the beginning */ 5667 need to restart from the beginning */
5668 pos = daemon->connections_head; 5668 pos = daemon->connections_head;
@@ -5688,7 +5688,7 @@ close_all_connections (struct MHD_Daemon *daemon)
5688 while (NULL != (pos = daemon->connections_head)) 5688 while (NULL != (pos = daemon->connections_head))
5689 { 5689 {
5690 if ( (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) && 5690 if ( (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) &&
5691 (MHD_YES != pos->thread_joined) ) 5691 (! pos->thread_joined) )
5692 MHD_PANIC (_("Failed to join a thread\n")); 5692 MHD_PANIC (_("Failed to join a thread\n"));
5693 close_connection (pos); 5693 close_connection (pos);
5694 } 5694 }
diff --git a/src/microhttpd/internal.h b/src/microhttpd/internal.h
index 5acc21d9..a562454e 100644
--- a/src/microhttpd/internal.h
+++ b/src/microhttpd/internal.h
@@ -811,9 +811,9 @@ struct MHD_Connection
811 int read_closed; 811 int read_closed;
812 812
813 /** 813 /**
814 * Set to #MHD_YES if the thread has been joined. 814 * Set to `true` if the thread has been joined.
815 */ 815 */
816 int thread_joined; 816 bool thread_joined;
817 817
818 /** 818 /**
819 * Are we currently inside the "idle" handler (to avoid recursively 819 * Are we currently inside the "idle" handler (to avoid recursively
diff --git a/src/testcurl/https/test_https_get.c b/src/testcurl/https/test_https_get.c
index f5b47e65..f8795b9b 100644
--- a/src/testcurl/https/test_https_get.c
+++ b/src/testcurl/https/test_https_get.c
@@ -43,9 +43,9 @@ test_cipher_option (FILE * test_fd,
43 const char *cipher_suite, 43 const char *cipher_suite,
44 int proto_version) 44 int proto_version)
45{ 45{
46
47 int ret; 46 int ret;
48 struct MHD_Daemon *d; 47 struct MHD_Daemon *d;
48
49 d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_TLS | 49 d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_TLS |
50 MHD_USE_ERROR_LOG, 4233, 50 MHD_USE_ERROR_LOG, 4233,
51 NULL, NULL, &http_ahc, NULL, 51 NULL, NULL, &http_ahc, NULL,