]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: receiver: link the receiver to its settings
authorWilly Tarreau <w@1wt.eu>
Thu, 3 Sep 2020 05:46:06 +0000 (07:46 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 16 Sep 2020 20:08:07 +0000 (22:08 +0200)
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.

include/haproxy/receiver-t.h
src/listener.c

index 2a52b472ef390d8a71f157e4f3d2626cfaa6f541..da40c15cdf71d4c16309f5abc5116dd2688b2e6a 100644 (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 */
index 1a8b5ad6594037e44fc846e0d8753a7b441c692d..ef9b7d01234112bde81445825f8bd4891567890b 100644 (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);