aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-11-04 14:30:24 +0100
committerChristian Grothoff <christian@grothoff.org>2016-11-04 14:30:24 +0100
commit86706fd27dde169fef4146d4014f948c2d7ffe55 (patch)
tree3edd2e3849926c0e099a187ed439a6d943daa734
parent82ce5348c515ab89da8521241c5d7c56d220ef45 (diff)
downloadlibmicrohttpd-86706fd27dde169fef4146d4014f948c2d7ffe55.tar.gz
libmicrohttpd-86706fd27dde169fef4146d4014f948c2d7ffe55.zip
use MHD_YES/MHD_NO instead of 0/not-0
-rw-r--r--src/microhttpd/daemon.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index f9ecc2ec..e25f96fe 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -91,10 +91,10 @@
91 */ 91 */
92#define DEBUG_CONNECT MHD_NO 92#define DEBUG_CONNECT MHD_NO
93 93
94/* Forward declarations. */ 94
95/** 95/**
96 * Close all connections for the daemon. 96 * Close all connections for the daemon.
97 * Must only be called when MHD_Daemon::shutdown was set to MHD_YES. 97 * Must only be called when MHD_Daemon::shutdown was set to #MHD_YES.
98 * @remark To be called only from thread that process 98 * @remark To be called only from thread that process
99 * daemon's select()/poll()/etc. 99 * daemon's select()/poll()/etc.
100 * 100 *
@@ -103,6 +103,7 @@
103static void 103static void
104close_all_connections (struct MHD_Daemon *daemon); 104close_all_connections (struct MHD_Daemon *daemon);
105 105
106
106/** 107/**
107 * Default implementation of the panic function, 108 * Default implementation of the panic function,
108 * prints an error message and aborts. 109 * prints an error message and aborts.
@@ -3661,7 +3662,7 @@ MHD_epoll (struct MHD_Daemon *daemon,
3661 unsigned int i; 3662 unsigned int i;
3662 unsigned int series_length; 3663 unsigned int series_length;
3663#if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT) 3664#if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT)
3664 _MHD_bool run_upgraded = 0; 3665 int run_upgraded = MHD_NO;
3665#endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */ 3666#endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */
3666 3667
3667 if (-1 == daemon->epoll_fd) 3668 if (-1 == daemon->epoll_fd)
@@ -3774,7 +3775,7 @@ MHD_epoll (struct MHD_Daemon *daemon,
3774 { 3775 {
3775 /* activity on an upgraded connection, we process 3776 /* activity on an upgraded connection, we process
3776 those in a separate epoll() */ 3777 those in a separate epoll() */
3777 run_upgraded = !0; 3778 run_upgraded = MHD_YES;
3778 continue; 3779 continue;
3779 } 3780 }
3780#endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */ 3781#endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */
@@ -3837,7 +3838,7 @@ MHD_epoll (struct MHD_Daemon *daemon,
3837 } 3838 }
3838 3839
3839#if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT) 3840#if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT)
3840 if (run_upgraded) 3841 if (MHD_YES == run_upgraded)
3841 run_epoll_for_upgrade (daemon); 3842 run_epoll_for_upgrade (daemon);
3842#endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */ 3843#endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */
3843 3844
@@ -5437,7 +5438,7 @@ thread_failed:
5437 5438
5438/** 5439/**
5439 * Close all connections for the daemon. 5440 * Close all connections for the daemon.
5440 * Must only be called when MHD_Daemon::shutdown was set to MHD_YES. 5441 * Must only be called when MHD_Daemon::shutdown was set to #MHD_YES.
5441 * @remark To be called only from thread that process 5442 * @remark To be called only from thread that process
5442 * daemon's select()/poll()/etc. 5443 * daemon's select()/poll()/etc.
5443 * 5444 *
@@ -5526,7 +5527,8 @@ close_all_connections (struct MHD_Daemon *daemon)
5526 MHD_PANIC (_("MHD_stop_daemon() called while we have suspended connections.\n")); 5527 MHD_PANIC (_("MHD_stop_daemon() called while we have suspended connections.\n"));
5527 for (pos = daemon->connections_head; NULL != pos; pos = pos->next) 5528 for (pos = daemon->connections_head; NULL != pos; pos = pos->next)
5528 { 5529 {
5529 shutdown (pos->socket_fd, SHUT_RDWR); 5530 shutdown (pos->socket_fd,
5531 SHUT_RDWR);
5530#if MHD_WINSOCK_SOCKETS 5532#if MHD_WINSOCK_SOCKETS
5531 if ( (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) && 5533 if ( (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) &&
5532 (MHD_ITC_IS_VALID_(daemon->itc)) && 5534 (MHD_ITC_IS_VALID_(daemon->itc)) &&