@cryptotaxi247 / netdata-1 / commits / 3b0f72b12

Keep transaction id of request headers (#16769)

keep the transaction id given in the request headers

Costa Tsaousis committed Jan 12, 2024 at 14:33 UTC 3b0f72b123f361fec43f2de11437bc464bcbd10a
1 file changed +5 -2
web/server/web_client.c
+5 -2
@@ -183,6 +183,7 @@ static void web_client_reset_allocations(struct web_client *w, bool free_all) {
183 web_client_flag_clear(w, WEB_CLIENT_CHUNKED_TRANSFER);
184 }
185
186 + memset(w->transaction, 0, sizeof(w->transaction));
187 web_client_flags_clear_auth(w);
188 web_client_flag_clear(w, WEB_CLIENT_ENCODING_GZIP|WEB_CLIENT_ENCODING_DEFLATE);
189 web_client_reset_path_flags(w);
@@ -1172,7 +1173,8 @@ int web_client_api_request_with_node_selection(RRDHOST *host, struct web_client
1173 ND_LOG_STACK_PUSH(lgs);
1174
1175 // give a new transaction id to the request
1175 - uuid_generate_random(w->transaction);
1176 + if(uuid_is_null(w->transaction))
1177 + uuid_generate_random(w->transaction);
1178
1179 static uint32_t
1180 hash_api = 0,
@@ -1397,7 +1399,8 @@ void web_client_process_request_from_web_server(struct web_client *w) {
1399 ND_LOG_STACK_PUSH(lgs);
1400
1401 // give a new transaction id to the request
1400 - uuid_generate_random(w->transaction);
1402 + if(uuid_is_null(w->transaction))
1403 + uuid_generate_random(w->transaction);
1404
1405 // start timing us
1406 web_client_timeout_checkpoint_init(w);