]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: opentracing: removed unused function flt_ot_var_get()
authorMiroslav Zagorac <mzagorac@haproxy.com>
Tue, 1 Mar 2022 17:39:18 +0000 (18:39 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 8 Apr 2022 14:31:33 +0000 (16:31 +0200)
The flt_ot_var_get() function is not used anywhere and is unnecessary
in the existing implementation of the OpenTracing filter.

This patch must be backported as far as 2.4.

addons/ot/include/vars.h
addons/ot/src/vars.c

index da1a0498611d7b3fe8de663bc17e51b5d4822726..c683b6bc6f648862eeb14861a1eba7c66171f483 100644 (file)
@@ -33,7 +33,6 @@ void                 flt_ot_vars_dump(struct stream *s);
 int                  flt_ot_var_register(const char *scope, const char *prefix, const char *name, char **err);
 int                  flt_ot_var_set(struct stream *s, const char *scope, const char *prefix, const char *name, const char *value, uint opt, char **err);
 int                  flt_ot_vars_unset(struct stream *s, const char *scope, const char *prefix, uint opt, char **err);
-int                  flt_ot_var_get(struct stream *s, const char *scope, const char *prefix, const char *name, char **value, uint opt, char **err);
 struct otc_text_map *flt_ot_vars_get(struct stream *s, const char *scope, const char *prefix, uint opt, char **err);
 
 #endif /* _OPENTRACING_VARS_H_ */
index b01094fbd2e08c6126dc19a1d91c01ddaa30ffb0..8769d54e75e16d679c1acd7f632ca7bc390e41b9 100644 (file)
@@ -390,54 +390,6 @@ int flt_ot_vars_unset(struct stream *s, const char *scope, const char *prefix, u
 }
 
 
-/***
- * NAME
- *   flt_ot_var_get -
- *
- * ARGUMENTS
- *   s      -
- *   scope  -
- *   prefix -
- *   name   -
- *   value  -
- *   opt    -
- *   err    -
- *
- * DESCRIPTION
- *   -
- *
- * RETURN VALUE
- *   -
- */
-int flt_ot_var_get(struct stream *s, const char *scope, const char *prefix, const char *name, char **value, uint opt, char **err)
-{
-       struct sample smp;
-       char          var_name[BUFSIZ], var_value[BUFSIZ];
-       int           retval;
-
-       FLT_OT_FUNC("%p, \"%s\", \"%s\", \"%s\", %p:%p, %u, %p:%p", s, scope, prefix, name, FLT_OT_DPTR_ARGS(value), opt, FLT_OT_DPTR_ARGS(err));
-
-       retval = flt_ot_var_name(scope, prefix, name, var_name, sizeof(var_name), err);
-       if (retval == -1)
-               FLT_OT_RETURN(retval);
-
-       (void)memset(&smp, 0, sizeof(smp));
-       (void)smp_set_owner(&smp, s->be, s->sess, s, opt | SMP_OPT_FINAL);
-
-       if (vars_get_by_name(var_name, retval, &smp, NULL)) {
-               retval = flt_ot_sample_to_str(&(smp.data), var_value, sizeof(var_value), err);
-               if (retval != -1)
-                       FLT_OT_DBG(3, "data type %d: '%s' = '%s'", smp.data.type, var_name, var_value);
-       } else {
-               FLT_OT_ERR("failed to get variable '%s'", var_name);
-
-               retval = -1;
-       }
-
-       FLT_OT_RETURN(retval);
-}
-
-
 /***
  * NAME
  *   flt_ot_vars_get -