session manager add udp eviction filter test case

This commit is contained in:
luwenpeng
2024-01-25 18:35:31 +08:00
parent 2cef03eee2
commit 5ba0e4bb3b
3 changed files with 154 additions and 4 deletions

View File

@@ -628,6 +628,8 @@ static void session_manager_update_udp_to_closing(struct session_manager *mgr, s
{
session_manager_update_session_state(mgr, sess, SESSION_STATE_CLOSING);
session_timer_del_session(mgr->sess_timer, sess);
session_queue_push(mgr->sess_toclosed_queue, sess);
eviction_filter_add(mgr->udp_eviction_filter, session_get0_1st_pkt(sess));
}
static void session_manager_update_tcp_to_opening(struct session_manager *mgr, struct session *sess, int opening_by_syn)
@@ -922,7 +924,14 @@ static void session_manager_free_session(struct session_manager *mgr, struct ses
{
SESSION_LOG_DEBUG("%s, session %lu closing -> closed", session_closing_reasion_tostring(session_get_closing_reasion(sess)), session_get_id(sess));
session_manager_update_session_to_closed(mgr, sess);
session_table_del_session(mgr->tcp_sess_table, session_get0_key(sess));
if (session_get_type(sess) == SESSION_TYPE_TCP)
{
session_table_del_session(mgr->tcp_sess_table, session_get0_key(sess));
}
if (session_get_type(sess) == SESSION_TYPE_UDP)
{
session_table_del_session(mgr->udp_sess_table, session_get0_key(sess));
}
session_set0_cur_pkt(sess, NULL);
session_set_cur_dir(sess, SESSION_DIR_NONE);
session_free(sess);
@@ -947,8 +956,9 @@ static void session_manager_recycle_session(struct session_manager *mgr)
static void session_manager_evicte_session(struct session_manager *mgr, struct session *sess)
{
session_set_closing_reasion(sess, CLOSING_BY_EVICTED);
session_manager_update_tcp_to_closing(mgr, sess, 0);
session_manager_update_session_state(mgr, sess, SESSION_STATE_CLOSING);
session_queue_push(mgr->sess_evicted_queue, sess);
session_timer_del_session(mgr->sess_timer, sess);
if (session_get_type(sess) == SESSION_TYPE_UDP)
{