mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-06 07:07:04 +02:00
BUG/MINOR: opentracing: setting the return value in function flt_ot_var_set()
Function flt_ot_var_set() did not check whether the variable was successfully set or not. In case of failure, the value -1 is returned. This patch must be backported as far as 2.4.
This commit is contained in:
parent
8c7927c6dd
commit
728627f932
@ -306,7 +306,13 @@ int flt_ot_var_set(struct stream *s, const char *scope, const char *prefix, cons
|
||||
smp.data.u.str.area = (char *)value;
|
||||
smp.data.u.str.data = strlen(value);
|
||||
|
||||
vars_set_by_name_ifexist(var_name, retval, &smp);
|
||||
if (vars_set_by_name_ifexist(var_name, retval, &smp) == 0) {
|
||||
FLT_OT_ERR("failed to set variable '%s'", var_name);
|
||||
|
||||
retval = -1;
|
||||
} else {
|
||||
FLT_OT_DBG(2, "variable '%s' set", var_name);
|
||||
}
|
||||
|
||||
FLT_OT_RETURN(retval);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user