[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [libmicrohttpd] 02/08: convert listen_socket_in_epoll to 'b
From: |
gnunet |
Subject: |
[GNUnet-SVN] [libmicrohttpd] 02/08: convert listen_socket_in_epoll to 'bool' |
Date: |
Wed, 15 Feb 2017 13:37:16 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository libmicrohttpd.
commit f9c239ec2a5d21a5ea4855fb002b65aeb10eb012
Author: Christian Grothoff <address@hidden>
AuthorDate: Wed Feb 15 13:27:42 2017 +0100
convert listen_socket_in_epoll to 'bool'
---
src/microhttpd/daemon.c | 22 +++++++++++-----------
src/microhttpd/internal.h | 6 +++---
2 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index e7d8ebf7..11df3a38 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -3727,7 +3727,7 @@ MHD_epoll (struct MHD_Daemon *daemon,
if ( (MHD_INVALID_SOCKET != (ls = daemon->listen_fd)) &&
(! daemon->was_quiesced) &&
(daemon->connections < daemon->connection_limit) &&
- (MHD_NO == daemon->listen_socket_in_epoll) &&
+ (! daemon->listen_socket_in_epoll) &&
(! daemon->at_limit) )
{
event.events = EPOLLIN;
@@ -3744,17 +3744,17 @@ MHD_epoll (struct MHD_Daemon *daemon,
#endif
return MHD_NO;
}
- daemon->listen_socket_in_epoll = MHD_YES;
+ daemon->listen_socket_in_epoll = true;
}
if ( (daemon->was_quiesced) &&
- (MHD_YES == daemon->listen_socket_in_epoll) )
+ (daemon->listen_socket_in_epoll) )
{
if (0 != epoll_ctl (daemon->epoll_fd,
EPOLL_CTL_DEL,
ls,
NULL))
MHD_PANIC ("Failed to remove listen FD from epoll set\n");
- daemon->listen_socket_in_epoll = MHD_NO;
+ daemon->listen_socket_in_epoll = false;
}
#if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT)
@@ -3778,7 +3778,7 @@ MHD_epoll (struct MHD_Daemon *daemon,
daemon->upgrade_fd_in_epoll = MHD_YES;
}
#endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */
- if ( (MHD_YES == daemon->listen_socket_in_epoll) &&
+ if ( (daemon->listen_socket_in_epoll) &&
( (daemon->connections == daemon->connection_limit) ||
(daemon->at_limit) ||
(daemon->was_quiesced) ) )
@@ -3790,7 +3790,7 @@ MHD_epoll (struct MHD_Daemon *daemon,
ls,
NULL))
MHD_PANIC (_("Failed to remove listen FD from epoll set\n"));
- daemon->listen_socket_in_epoll = MHD_NO;
+ daemon->listen_socket_in_epoll = false;
}
if (MHD_YES == may_block)
{
@@ -4207,14 +4207,14 @@ MHD_quiesce_daemon (struct MHD_Daemon *daemon)
#ifdef EPOLL_SUPPORT
if ( (0 != (daemon->options & MHD_USE_EPOLL)) &&
(-1 != daemon->worker_pool[i].epoll_fd) &&
- (MHD_YES == daemon->worker_pool[i].listen_socket_in_epoll) )
+ (daemon->worker_pool[i].listen_socket_in_epoll) )
{
if (0 != epoll_ctl (daemon->worker_pool[i].epoll_fd,
EPOLL_CTL_DEL,
ret,
NULL))
MHD_PANIC (_("Failed to remove listen FD from epoll set\n"));
- daemon->worker_pool[i].listen_socket_in_epoll = MHD_NO;
+ daemon->worker_pool[i].listen_socket_in_epoll = false;
}
else
#endif
@@ -4228,14 +4228,14 @@ MHD_quiesce_daemon (struct MHD_Daemon *daemon)
#ifdef EPOLL_SUPPORT
if ( (0 != (daemon->options & MHD_USE_EPOLL)) &&
(-1 != daemon->epoll_fd) &&
- (MHD_YES == daemon->listen_socket_in_epoll) )
+ (daemon->listen_socket_in_epoll) )
{
if (0 != epoll_ctl (daemon->epoll_fd,
EPOLL_CTL_DEL,
ret,
NULL))
MHD_PANIC ("Failed to remove listen FD from epoll set\n");
- daemon->listen_socket_in_epoll = MHD_NO;
+ daemon->listen_socket_in_epoll = false;
}
#endif
if ( (MHD_ITC_IS_VALID_(daemon->itc)) &&
@@ -4752,6 +4752,7 @@ setup_epoll_to_listen (struct MHD_Daemon *daemon)
#endif
return MHD_NO;
}
+ daemon->listen_socket_in_epoll = true;
if (MHD_ITC_IS_VALID_(daemon->itc))
{
event.events = EPOLLIN;
@@ -4770,7 +4771,6 @@ setup_epoll_to_listen (struct MHD_Daemon *daemon)
return MHD_NO;
}
}
- daemon->listen_socket_in_epoll = MHD_YES;
return MHD_YES;
}
#endif
diff --git a/src/microhttpd/internal.h b/src/microhttpd/internal.h
index 111af62f..b9c30b5d 100644
--- a/src/microhttpd/internal.h
+++ b/src/microhttpd/internal.h
@@ -1394,10 +1394,10 @@ struct MHD_Daemon
int epoll_fd;
/**
- * #MHD_YES if the listen socket is in the 'epoll' set,
- * #MHD_NO if not.
+ * true if the listen socket is in the 'epoll' set,
+ * false if not.
*/
- int listen_socket_in_epoll;
+ bool listen_socket_in_epoll;
#if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT)
/**
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [libmicrohttpd] branch master updated (2a815fe3 -> f154b0ef), gnunet, 2017/02/15
- [GNUnet-SVN] [libmicrohttpd] 06/08: convert tls_closed to 'bool', gnunet, 2017/02/15
- [GNUnet-SVN] [libmicrohttpd] 01/08: fix race related to MHD_quiesce_daemon setting the listen socket to -1 which may disrupt concurrent non-locking activities by instead setting a flag (which suffices given the document semantics of MHD_quiesce_daemon()); renaming the socket_fd to listen_fd to distinguish it better by name, gnunet, 2017/02/15
- [GNUnet-SVN] [libmicrohttpd] 03/08: convert upgrade_fd_in_epoll to 'bool', gnunet, 2017/02/15
- [GNUnet-SVN] [libmicrohttpd] 08/08: bump dates and versions and update ChangeLog, gnunet, 2017/02/15
- [GNUnet-SVN] [libmicrohttpd] 04/08: convert have_dhparams to 'bool', gnunet, 2017/02/15
- [GNUnet-SVN] [libmicrohttpd] 02/08: convert listen_socket_in_epoll to 'bool',
gnunet <=
- [GNUnet-SVN] [libmicrohttpd] 07/08: convert client_aware to 'bool', gnunet, 2017/02/15
- [GNUnet-SVN] [libmicrohttpd] 05/08: convert clean_ready to 'bool', gnunet, 2017/02/15