执行resetall指令:Sapp重启后发送resetall状态通知SCE清空流表

This commit is contained in:
luwenpeng
2023-02-17 17:45:39 +08:00
parent e6a3f5c1dc
commit 0ba7fefba5
6 changed files with 73 additions and 2 deletions

View File

@@ -47,6 +47,30 @@ void session_table_destory(struct session_table *table)
}
}
void session_table_reset(struct session_table *table)
{
if (table)
{
struct session_node *temp = NULL;
struct session_node *node = NULL;
HASH_ITER(hh1, table->root_by_id, node, temp)
{
HASH_DELETE(hh1, table->root_by_id, node);
HASH_DELETE(hh2, table->root_by_addr, node);
if (node->val_freecb && node->val_data)
{
node->val_freecb(node->val_data);
}
free(node);
node = NULL;
table->session_node_count--;
}
}
}
uint64_t session_table_count(struct session_table *table)
{
if (table)