MEDIUM: listeners: split the thread mask between receiver and bind_conf
With groups at some point we'll have to have distinct masks/groups in the
receiver and the bind_conf, because a single bind_conf might require to
instantiate multiple receivers (one per group).
Let's split the thread mask and group to have one for the bind_conf and
another one for the receiver while it remains easy to do. This will later
allow to use different storage for the bind_conf if needed (e.g. support
multiple groups).
diff --git a/src/listener.c b/src/listener.c
index b89aa98..112455a 100644
--- a/src/listener.c
+++ b/src/listener.c
@@ -906,7 +906,7 @@
#if defined(USE_THREAD)
- mask = thread_mask(l->rx.settings->bind_thread) & all_threads_mask;
+ mask = thread_mask(l->rx.bind_thread) & all_threads_mask;
if (atleast2(mask) && (global.tune.options & GTUNE_LISTENER_MQ) && !stopping) {
struct accept_queue_ring *ring;
unsigned int t, t0, t1, t2;
@@ -1563,7 +1563,7 @@
*slash = '/';
}
- conf->settings.bind_thread |= thread;
+ conf->bind_thread |= thread;
memprintf(err, "'process %s' on 'bind' lines is deprecated and will be removed in 2.7.", args[cur_arg+1]);
if (slash)
@@ -1612,8 +1612,8 @@
sep = args[cur_arg + 1];
}
- if ((conf->settings.bind_tgroup || conf->settings.bind_thread) &&
- conf->settings.bind_tgroup != tgroup) {
+ if ((conf->bind_tgroup || conf->bind_thread) &&
+ conf->bind_tgroup != tgroup) {
memprintf(err, "'%s' multiple thread-groups are not supported", args[cur_arg + 1]);
return ERR_ALERT | ERR_FATAL;
}
@@ -1623,8 +1623,8 @@
return ERR_ALERT | ERR_FATAL;
}
- conf->settings.bind_thread |= thread;
- conf->settings.bind_tgroup = tgroup;
+ conf->bind_thread |= thread;
+ conf->bind_tgroup = tgroup;
return 0;
}