summaryrefslogtreecommitdiffhomepage
path: root/src/child.c
diff options
context:
space:
mode:
authorrofl0r <rofl0r@users.noreply.github.com>2020-01-15 16:09:41 +0000
committerrofl0r <rofl0r@users.noreply.github.com>2020-01-15 16:09:41 +0000
commitc63d5d26b47b44d70af54aa31f811e4815fe4ad9 (patch)
tree7f2709f94c4249c7f6b8cce4087680faf4ba7bee /src/child.c
parentbffa70500562f0ed675ed8d7e2385925c25f14fc (diff)
access config via a pointer, not a hardcoded struct address
this is required so we can elegantly swap out an old config for a new one in the future and remove lots of boilerplate from config initialization code. unfortunately this is a quite intrusive change as the config struct was accessed in numerous places, but frankly it should have been done via a pointer right from the start. right now, we simply point to a static struct in main.c, so there shouldn't be any noticeable changes in behaviour.
Diffstat (limited to 'src/child.c')
-rw-r--r--src/child.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/child.c b/src/child.c
index 861606b..4a94b98 100644
--- a/src/child.c
+++ b/src/child.c
@@ -86,7 +86,7 @@ void child_main_loop (void)
pthread_attr_t *attrp, attr;
struct child *child;
- childs = sblist_new(sizeof (struct child*), config.maxclients);
+ childs = sblist_new(sizeof (struct child*), config->maxclients);
loop_records_init();
@@ -94,11 +94,11 @@ void child_main_loop (void)
* We have to wait for connections on multiple fds,
* so use select.
*/
- while (!config.quit) {
+ while (!config->quit) {
collect_threads();
- if (sblist_getsize(childs) >= config.maxclients) {
+ if (sblist_getsize(childs) >= config->maxclients) {
if (!was_full)
log_message (LOG_NOTICE,
"Maximum number of connections reached. "