mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-13 12:56:20 -04:00
CLEANUP: stream: Explain the two-step initialization in stream_generate_unique_id()
This two-step initialization of `strm->unique_id` looks like a refactoring
target. Add a comment to prevent regressions of the fix in
fb7b5c8a53.
This commit is contained in:
parent
756ad19f04
commit
f778e6feb0
1 changed files with 3 additions and 0 deletions
|
|
@ -3102,6 +3102,9 @@ struct ist stream_generate_unique_id(struct stream *strm, struct lf_expr *format
|
|||
if ((unique_id = pool_alloc(pool_head_uniqueid)) == NULL)
|
||||
return IST_NULL;
|
||||
|
||||
/* Initialize ->unique_id to an empty string to prevent infinite
|
||||
* recursion when the <format> references %[unique-id] or %ID.
|
||||
*/
|
||||
strm->unique_id = ist2(unique_id, 0);
|
||||
strm->unique_id.len = build_logline(strm, unique_id, UNIQUEID_LEN, format);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue