MINOR: receiver: link the receiver to its settings

Just like listeners keep a pointer to their bind_conf, receivers now also
have a pointer to their rx_settings. All those belonging to a listener are
automatically initialized with a pointer to the bind_conf's settings.
This commit is contained in:
Willy Tarreau 2020-09-03 07:46:06 +02:00
parent d45693d85c
commit 0fce6bce34
2 changed files with 2 additions and 1 deletions

View File

@ -47,6 +47,7 @@ struct receiver {
int fd; /* handle we receive from (fd only for now) */
unsigned int flags; /* receiver options (RX_F_*) */
struct protocol *proto; /* protocol this receiver belongs to */
struct rx_settings *settings; /* points to the settings used by this receiver */
struct list proto_list; /* list in the protocol header */
/* warning: this struct is huge, keep it at the bottom */
struct sockaddr_storage addr; /* the address the socket is bound to */

View File

@ -563,7 +563,7 @@ int create_listeners(struct bind_conf *bc, const struct sockaddr_storage *ss,
LIST_ADDQ(&bc->frontend->conf.listeners, &l->by_fe);
LIST_ADDQ(&bc->listeners, &l->by_bind);
l->bind_conf = bc;
l->rx.settings = &bc->settings;
l->rx.fd = fd;
memcpy(&l->rx.addr, ss, sizeof(*ss));
MT_LIST_INIT(&l->wait_queue);