mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-08 20:40:59 +01:00
BUG/MINOR: ech: non destructive parsing in cli_find_ech_specific_ctx()
cli_find_ech_specific_ctx() parses the <frontend>/<bind_conf> and sets a \0 in place the '/'. But the originals tring is still used to emit messages in the CLI so we only output the frontend part. This patch do the parsing in a trash buffer instead.
This commit is contained in:
parent
37f76c45fa
commit
f6503bd7d3
14
src/ech.c
14
src/ech.c
@ -84,25 +84,27 @@ end:
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*
|
||||
/* find a named SSL_CTX, returns 1 if found
|
||||
*
|
||||
* <name> should be in the format "frontend/@<filename>:<linenum>"
|
||||
* Example:
|
||||
* "http1/@haproxy.cfg:1234"
|
||||
*
|
||||
*/
|
||||
|
||||
/* find a named SSL_CTX, returns 1 if found */
|
||||
static int cli_find_ech_specific_ctx(char *name, SSL_CTX **sctx)
|
||||
static int cli_find_ech_specific_ctx(const char *name, SSL_CTX **sctx)
|
||||
{
|
||||
struct proxy *p;
|
||||
struct bind_conf *bind_conf;
|
||||
char *pname; /* proxy name */
|
||||
char *bname; /* bind_name */
|
||||
struct buffer *tmp = get_trash_chunk();
|
||||
|
||||
if (!name || !sctx)
|
||||
return 0;
|
||||
|
||||
for (pname = bname = name; *bname != '\0' && *bname != '/'; bname++)
|
||||
|
||||
b_putblk(tmp, name, strlen(name) + 1);
|
||||
|
||||
for (pname = bname = tmp->area; *bname != '\0' && *bname != '/'; bname++)
|
||||
;
|
||||
|
||||
if (*bname) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user