]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: receiver: link the receiver to its owner
authorWilly Tarreau <w@1wt.eu>
Thu, 3 Sep 2020 08:05:03 +0000 (10:05 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 16 Sep 2020 20:08:07 +0000 (22:08 +0200)
A receiver will have to pass a context to be installed into the fdtab
for use by the handler. We need to set this into the receiver struct
as the bind will happen longer after the configuration.

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

index da40c15cdf71d4c16309f5abc5116dd2688b2e6a..5b45dc2692115b32ad785550ff0220c16a8a248f 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 */
+       void *owner;                     /* receiver's owner (usually a listener) */
        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 */
index ef9b7d01234112bde81445825f8bd4891567890b..75115f463ea9f9ee7216ee72bbf55168a60d4e14 100644 (file)
@@ -564,6 +564,7 @@ int create_listeners(struct bind_conf *bc, const struct sockaddr_storage *ss,
                LIST_ADDQ(&bc->listeners, &l->by_bind);
                l->bind_conf = bc;
                l->rx.settings = &bc->settings;
+               l->rx.owner = l;
                l->rx.fd = fd;
                memcpy(&l->rx.addr, ss, sizeof(*ss));
                MT_LIST_INIT(&l->wait_queue);