BUILD: opentracing: exclude the use of haproxy variables for the OpenTracing context

Due to a recent change in the handling of haproxy variables, their use for
OpenTracing context transfer has been excluded from the compilation process.

The use of variables can be re-enabled if the newly defined variable
OT_USE_VARS is set to 1 when calling the 'make' utility.  However,
this should not be used for now as the compilation will end in error.

This change prevents the use of haproxy variables to convey the OpenTracing
context.  This means that the 'use-vars' parameter cannot be used in the
OpenTracing filter configuration for 'inject' and 'extract' operations.

An example configuration that uses this feature is in the test/ctx
directory, while the script to run that test is test/run-ctx.sh.

Then, the 'sess.ot.uuid' variable is no longer set when initializing the
OpenTracing session.  This means that this variable can still be used in
the OpenTracing configuration, but its contents will be empty.
diff --git a/addons/ot/src/event.c b/addons/ot/src/event.c
index 90b5828..0cb6b1d 100644
--- a/addons/ot/src/event.c
+++ b/addons/ot/src/event.c
@@ -85,12 +85,14 @@
 
 			if (conf_span->ctx_flags & (FLT_OT_CTX_USE_VARS | FLT_OT_CTX_USE_HEADERS)) {
 				for (text_map = &(writer.text_map); i < text_map->count; i++) {
+#ifdef USE_OT_VARS
 					if (!(conf_span->ctx_flags & FLT_OT_CTX_USE_VARS))
 						/* Do nothing. */;
 					else if (flt_ot_var_register(FLT_OT_VARS_SCOPE, conf_span->ctx_id, text_map->key[i], err) == -1)
 						retval = FLT_OT_RET_ERROR;
 					else if (flt_ot_var_set(s, FLT_OT_VARS_SCOPE, conf_span->ctx_id, text_map->key[i], text_map->value[i], dir, err) == -1)
 						retval = FLT_OT_RET_ERROR;
+#endif
 
 					if (!(conf_span->ctx_flags & FLT_OT_CTX_USE_HEADERS))
 						/* Do nothing. */;
@@ -184,7 +186,7 @@
 	}
 
 	list_for_each_entry(conf_ctx, &(conf_scope->contexts), list) {
-		struct otc_text_map *text_map;
+		struct otc_text_map *text_map = NULL;
 
 		FLT_OT_DBG(3, "run context '%s' -> '%s'", conf_scope->id, conf_ctx->id);
 		FLT_OT_DBG_CONF_CONTEXT("run context ", conf_ctx);
@@ -195,8 +197,10 @@
 		 */
 		if (conf_ctx->flags & FLT_OT_CTX_USE_HEADERS)
 			text_map = flt_ot_http_headers_get(chn, conf_ctx->id, conf_ctx->id_len, err);
+#ifdef USE_OT_VARS
 		else
 			text_map = flt_ot_vars_get(s, FLT_OT_VARS_SCOPE, conf_ctx->id, dir, err);
+#endif
 
 		if (text_map != NULL) {
 			if (flt_ot_scope_context_init(f->ctx, conf->tracer->tracer, conf_ctx->id, conf_ctx->id_len, text_map, dir, err) == NULL)
@@ -314,7 +318,9 @@
 			retval = FLT_OT_RET_ERROR;
 	}
 
+#ifdef USE_OT_VARS
 	flt_ot_vars_dump(s);
+#endif
 	flt_ot_http_headers_dump(chn);
 
 	FLT_OT_DBG(3, "event = %d, chn = %p, s->req = %p, s->res = %p", event, chn, &(s->req), &(s->res));
diff --git a/addons/ot/src/filter.c b/addons/ot/src/filter.c
index 04c4a67..bd71186 100644
--- a/addons/ot/src/filter.c
+++ b/addons/ot/src/filter.c
@@ -560,7 +560,9 @@
 
 	FLT_OT_LOG(LOG_INFO, "%08x %08x", f->pre_analyzers, f->post_analyzers);
 
+#ifdef USE_OT_VARS
 	flt_ot_vars_dump(s);
+#endif
 	flt_ot_http_headers_dump(&(s->req));
 
 	FLT_OT_RETURN(FLT_OT_RET_OK);
diff --git a/addons/ot/src/parser.c b/addons/ot/src/parser.c
index e26ca18..ae09e02 100644
--- a/addons/ot/src/parser.c
+++ b/addons/ot/src/parser.c
@@ -720,8 +720,10 @@
 
 	if (strcmp(args[cur_arg], FLT_OT_PARSE_CTX_USE_HEADERS) == 0)
 		flags = FLT_OT_CTX_USE_HEADERS;
+#ifdef USE_OT_VARS
 	else if (strcmp(args[cur_arg], FLT_OT_PARSE_CTX_USE_VARS) == 0)
 		flags = FLT_OT_CTX_USE_VARS;
+#endif
 	else
 		FLT_OT_PARSE_ERR(err, "'%s' : invalid context storage type", args[0]);
 
@@ -939,8 +941,10 @@
 			conf_ctx->flags = FLT_OT_CTX_USE_HEADERS;
 		else if (strcmp(args[2], FLT_OT_PARSE_CTX_USE_HEADERS) == 0)
 			conf_ctx->flags = FLT_OT_CTX_USE_HEADERS;
+#ifdef USE_OT_VARS
 		else if (strcmp(args[2], FLT_OT_PARSE_CTX_USE_VARS) == 0)
 			conf_ctx->flags = FLT_OT_CTX_USE_VARS;
+#endif
 		else
 			FLT_OT_PARSE_ERR(&err, "'%s' : invalid context storage type", args[2]);
 	}
diff --git a/addons/ot/src/scope.c b/addons/ot/src/scope.c
index 8d70a08..112f9d5 100644
--- a/addons/ot/src/scope.c
+++ b/addons/ot/src/scope.c
@@ -120,8 +120,14 @@
 	               (uint16_t)(retptr->uuid.clock_seq | UINT16_C(0x8000)),
 	               (uint64_t)retptr->uuid.node);
 
-	if (flt_ot_var_register(FTL_OT_VAR_UUID, err) != -1)
-		(void)flt_ot_var_set(s, FTL_OT_VAR_UUID, retptr->uuid.s, SMP_OPT_DIR_REQ, err);
+#ifdef USE_OT_VARS
+	/*
+	 * The HAProxy variable 'sess.ot.uuid' is registered here,
+	 * after which its value is set to runtime context UUID.
+	 */
+	if (flt_ot_var_register(FLT_OT_VAR_UUID, err) != -1)
+		(void)flt_ot_var_set(s, FLT_OT_VAR_UUID, retptr->uuid.s, SMP_OPT_DIR_REQ, err);
+#endif
 
 	FLT_OT_DBG_RUNTIME_CONTEXT("session context: ", retptr);
 
@@ -610,7 +616,9 @@
 				 * the context in question should be deleted.
 				 */
 				(void)flt_ot_http_headers_remove(chn, ctx->id, NULL);
+#ifdef USE_OT_VARS
 				(void)flt_ot_vars_unset(rt_ctx->stream, FLT_OT_VARS_SCOPE, ctx->id, ctx->smp_opt_dir, NULL);
+#endif
 
 				flt_ot_scope_context_free(&ctx);
 			}