From b4590639fad60b702a8cb5a9ec123354d81c3770 Mon Sep 17 00:00:00 2001 From: Mariappan Ramasamy <142216110+kp-mariappan-ramasamy@users.noreply.github.com> Date: Wed, 27 Nov 2024 11:04:01 +0800 Subject: [PATCH] Make nudge threadsafe --- src/he/he_internal.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/he/he_internal.h b/src/he/he_internal.h index 733a07c..511bd28 100644 --- a/src/he/he_internal.h +++ b/src/he/he_internal.h @@ -148,7 +148,7 @@ struct he_conn { bool is_server; /// Client State - he_conn_state_t state; + _Atomic he_conn_state_t state; /// Pointer to incoming data buffer uint8_t *incoming_data; @@ -157,7 +157,7 @@ struct he_conn { // WolfSSL stuff WOLFSSL *wolf_ssl; /// Wolf Timeout - int wolf_timeout; + _Atomic int wolf_timeout; /// Write buffer uint8_t write_buffer[HE_MAX_WIRE_MTU]; /// Packet seen @@ -178,7 +178,7 @@ struct he_conn { bool renegotiation_due; /// Do we already have a timer running? If so, we don't want to generate new callbacks - bool is_nudge_timer_running; + _Atomic bool is_nudge_timer_running; he_plugin_chain_t *inside_plugins; he_plugin_chain_t *outside_plugins;