]> Kevux Git Server - kevux-tools/commitdiff
Feature: Use the newly added f_random_array_shuffle() in tacocat.
authorKevin Day <kevin@kevux.org>
Tue, 12 Mar 2024 00:36:36 +0000 (19:36 -0500)
committerKevin Day <kevin@kevux.org>
Tue, 12 Mar 2024 00:36:36 +0000 (19:36 -0500)
The send() packet now automatically randomizes the header structure using f_random_array_shuffle().

sources/c/tacocat/main/common/print.c
sources/c/tacocat/main/common/print.h
sources/c/tacocat/main/send.c

index 664e5e6fa3e25c7b64b04ad21e0db0a5824075d2..183a257794f3332c2eb58cfe5f00d24146150ac3 100644 (file)
@@ -22,6 +22,7 @@ extern "C" {
     "f_network_from_ip_name",
     "f_network_from_ip_string",
     "f_network_is_ip_address",
+    "f_random_array_shuffle",
     "f_socket_accept",
     "f_socket_bind",
     "f_socket_close",
index f275829dea81fea5f220a6c51346c016561c94b4..d1556a1d92924445067ced6a783be039def3bde4 100644 (file)
@@ -55,6 +55,7 @@ extern "C" {
     kt_tacocat_f_f_network_from_ip_name_e,
     kt_tacocat_f_f_network_from_ip_string_e,
     kt_tacocat_f_f_network_is_ip_address_e,
+    kt_tacocat_f_f_random_array_shuffle_e,
     kt_tacocat_f_f_socket_accept_e,
     kt_tacocat_f_f_socket_bind_e,
     kt_tacocat_f_f_socket_close_e,
index 03d02d2648c0e014d5c0412e5c25b815167e52a2..9f98e2fa4197a55d3d658d5c9e035c3eba09c356 100644 (file)
@@ -204,6 +204,12 @@ extern "C" {
 
       macro_kt_send_process_handle_error_exit_1(main, fl_fss_payload_header_map, kt_tacocat_send_build_s, set->network, set->status, set->name, set->step);
 
+      set->write_state.cache->used = 0;
+
+      set->status = f_random_array_shuffle(0, set->headers.used, sizeof(f_string_map_t), set->write_state.cache, (void *) set->headers.array);
+
+      macro_kt_send_process_handle_error_exit_1(main, f_random_array_shuffle, kt_tacocat_send_build_s, set->network, set->status, set->name, set->step);
+
       set->step = kt_tacocat_socket_step_send_header_e;
     }