Fix some shutdown issues in connection tracker code.

This commit is contained in:
2024-05-16 12:41:48 -04:00
parent 523c9c9ad2
commit e56dc207d1
3 changed files with 20 additions and 0 deletions

View File

@ -86,6 +86,10 @@ typedef struct _tf_ssb_connections_get_next_t
static void _tf_ssb_connections_get_next_work(tf_ssb_t* ssb, void* user_data)
{
tf_ssb_connections_get_next_t* next = user_data;
if (tf_ssb_is_shutting_down(ssb))
{
return;
}
next->ready = _tf_ssb_connections_get_next_connection(next->connections, next->host, sizeof(next->host), &next->port, next->key, sizeof(next->key));
}
@ -159,6 +163,10 @@ typedef struct _tf_ssb_connections_update_t
static void _tf_ssb_connections_update_work(tf_ssb_t* ssb, void* user_data)
{
tf_ssb_connections_update_t* update = user_data;
if (tf_ssb_is_shutting_down(ssb))
{
return;
}
sqlite3_stmt* statement;
sqlite3* db = tf_ssb_acquire_db_writer(ssb);
if (update->attempted)