]> git.kaiwu.me - haproxy.git/commitdiff
CLEANUP: http_fetch: Use local `unique_id` variable in `smp_fetch_uniqueid()`
authorTim Duesterhus <tim@bastelstu.be>
Fri, 3 Apr 2026 21:29:01 +0000 (23:29 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 13 Apr 2026 12:02:29 +0000 (14:02 +0200)
Instead of relying on the implementation detail that
`stream_generate_unique_id()` will store the unique ID in `strm->unique_id` we
should use the returned value, especially since that one is already checked in
the `isttest()`.

Reviewed-by: Volker Dusch <github@wallbash.com>
src/http_fetch.c

index c4aceaf3b7802d44a7dd089819df6ef9fde7ca35..e49c8bb71436593d621907ae2ed9eae04433516d 100644 (file)
@@ -515,8 +515,8 @@ static int smp_fetch_uniqueid(const struct arg *args, struct sample *smp, const
        if (!isttest(unique_id))
                return 0;
 
-       smp->data.u.str.area = smp->strm->unique_id.ptr;
-       smp->data.u.str.data = smp->strm->unique_id.len;
+       smp->data.u.str.area = istptr(unique_id);
+       smp->data.u.str.data = istlen(unique_id);
        smp->data.type = SMP_T_STR;
        smp->flags = SMP_F_CONST;
        return 1;