]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stream: Add a pointer to set the parent stream
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 16 Jul 2024 13:55:57 +0000 (15:55 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 18 Jul 2024 14:39:38 +0000 (16:39 +0200)
A pointer to a parent stream was added in the stream structure. For now,
this pointer is never set, but the idea is to have an access to a stream
environment from another one from the moment there is a parent/child
relationship betwee these streams.

Concretely, for now, there is nothing to formalize this relationship.

include/haproxy/stream-t.h
src/stream.c

index 9b8111c1e232d4268a6909413617d482c1784f72..66ac498ce66afe5f7250be8c417467ff0b6baaae 100644 (file)
@@ -234,6 +234,9 @@ struct stream {
        int conn_retries;               /* number of connect retries performed */
        unsigned int conn_exp;          /* wake up time for connect, queue, turn-around, ... */
        unsigned int conn_err_type;     /* first error detected, one of STRM_ET_* */
+
+       struct stream *parent;          /* Pointer to the parent stream, if any. NULL most of time */
+
        struct list list;               /* position in the thread's streams list */
        struct mt_list by_srv;          /* position in server stream list */
        struct list back_refs;          /* list of users tracking this stream */
index 7c2160b222cf33b1c95cfea098e5b5dbe29a8809..c78c6a10a6e476bf3d9861d8462c02872f078662 100644 (file)
@@ -424,7 +424,7 @@ struct stream *stream_new(struct session *sess, struct stconn *sc, struct buffer
        s->pcli_next_pid = 0;
        s->pcli_flags = 0;
        s->unique_id = IST_NULL;
-
+       s->parent = NULL;
        if ((t = task_new_here()) == NULL)
                goto out_fail_alloc;