MINOR: chunk: add chunk_istcat() to concatenate an ist after a chunk
authorWilly Tarreau <w@1wt.eu>
Tue, 29 Oct 2019 12:02:15 +0000 (13:02 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 29 Oct 2019 12:09:14 +0000 (13:09 +0100)
commit20020ae804033e67675802031adcd0f3983f15ef
treee459d51e1a2b06a02899400314b88060e253dd7b
parentc1b16734c017118ce6582b16ea724ec6095e5fc9
MINOR: chunk: add chunk_istcat() to concatenate an ist after a chunk

We previously relied on chunk_cat(dst, b_fromist(src)) for this but it
is not reliable as the allocated buffer is inside the expression and
may be on a temporary stack. While it's possible to allocate stack space
for a struct and return a pointer to it, it's not possible to initialize
it form a temporary variable to prevent arguments from being evaluated
multiple times. Since this is only used to append an ist after a chunk,
let's instead have a chunk_istcat() function to perform exactly this
from a native ist.

The only call place (URI computation in the cache) was updated.
include/common/chunk.h
src/cache.c