MINOR: listener: prefer to retrieve the socket's settings via the receiver
Some socket settings used to be retrieved via the listener and the
bind_conf. Now instead we use the receiver and its settings whenever
appropriate. This will simplify the removal of the dependency on the
listener.
diff --git a/src/listener.c b/src/listener.c
index 75115f4..4026ea2 100644
--- a/src/listener.c
+++ b/src/listener.c
@@ -235,7 +235,7 @@
HA_SPIN_LOCK(LISTENER_LOCK, &listener->lock);
if (listener->state == LI_LISTEN) {
if ((global.mode & (MODE_DAEMON | MODE_MWORKER)) &&
- !(proc_mask(listener->bind_conf->settings.bind_proc) & pid_bit)) {
+ !(proc_mask(listener->rx.settings->bind_proc) & pid_bit)) {
/* we don't want to enable this listener and don't
* want any fd event to reach it.
*/
@@ -342,7 +342,7 @@
goto end;
if ((global.mode & (MODE_DAEMON | MODE_MWORKER)) &&
- !(proc_mask(l->bind_conf->settings.bind_proc) & pid_bit))
+ !(proc_mask(l->rx.settings->bind_proc) & pid_bit))
goto end;
if (l->state == LI_ASSIGNED) {
@@ -383,11 +383,11 @@
goto end;
}
- if (!(thread_mask(l->bind_conf->settings.bind_thread) & tid_bit)) {
+ if (!(thread_mask(l->rx.settings->bind_thread) & tid_bit)) {
/* we're not allowed to touch this listener's FD, let's requeue
* the listener into one of its owning thread's queue instead.
*/
- int first_thread = my_flsl(thread_mask(l->bind_conf->settings.bind_thread) & all_threads_mask) - 1;
+ int first_thread = my_flsl(thread_mask(l->rx.settings->bind_thread) & all_threads_mask) - 1;
work_list_add(&local_listener_queue[first_thread], &l->wait_queue);
goto end;
}
@@ -875,7 +875,7 @@
next_actconn = 0;
#if defined(USE_THREAD)
- mask = thread_mask(l->bind_conf->settings.bind_thread) & all_threads_mask;
+ mask = thread_mask(l->rx.settings->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;