Hello all, the second patch from the last series of patches has been redesigned here, the ist() function is used to set an empty string instead of working directly with the string pointer.
I thank Tim Düsterhus for his advice. Best regards, -- Zaga <[email protected]> What can change the nature of a man?
>From 661e87f9b897924d786c887d19b211816443eed5 Mon Sep 17 00:00:00 2001 From: Miroslav Zagorac <[email protected]> Date: Thu, 9 Sep 2021 01:23:42 +0200 Subject: [PATCH 2/4] BUG/MINOR: opentracing: enable the use of http headers without a set value In case we transfer some data that does not have a set value via the HTTP header, adding that header in the text map was done incorrectly. This simple patch allows the use of HTTP headers without a set value. --- addons/ot/src/http.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/addons/ot/src/http.c b/addons/ot/src/http.c index 4a12ed854..0ed4970e5 100644 --- a/addons/ot/src/http.c +++ b/addons/ot/src/http.c @@ -133,6 +133,16 @@ struct otc_text_map *flt_ot_http_headers_get(struct channel *chn, const char *pr v = htx_get_blk_value(htx, blk); + /* + * In case the data of the HTTP header is not + * specified, v.len will be equal to 0, and + * the function otc_text_map_add() will not + * interpret this well. In this case v.ptr + * is set to an empty string. + */ + if (v.len == 0) + v = ist(""); + /* * Here, an HTTP header (which is actually part * of the span context is added to the text_map. -- 2.30.1

