File tree Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -245,6 +245,32 @@ proc_when_sess_created(tc_sess_t *s)
245245 return TC_OK ;
246246}
247247
248+ static int
249+ proc_when_sess_destroyed (tc_sess_t * s )
250+ {
251+ link_list * list ;
252+ p_link_node ln , tln ;
253+ mysql_table_item_t * item ;
254+
255+ item = hash_find (ctx .table , s -> hash_key );
256+ if (item != NULL ) {
257+ list = item -> list ;
258+ ln = link_list_first (list );
259+ while (ln ) {
260+ tln = ln ;
261+ ln = link_list_get_next (list , ln );
262+ link_list_remove (list , tln );
263+ tc_pfree (ctx .pool , tln -> data );
264+ tc_pfree (ctx .pool , tln );
265+ }
266+
267+ tc_pfree (ctx .pool , list );
268+
269+ hash_del (ctx .table , ctx .pool , s -> hash_key );
270+ }
271+
272+ return TC_OK ;
273+ }
248274
249275static int
250276proc_auth (tc_sess_t * s , tc_iph_t * ip , tc_tcph_t * tcp )
@@ -323,7 +349,7 @@ tc_module_t tc_mysql_module = {
323349 prepare_for_renew_session ,
324350 check_pack_needed_for_recons ,
325351 proc_when_sess_created ,
326- NULL ,
352+ proc_when_sess_destroyed ,
327353 NULL ,
328354 proc_auth ,
329355 NULL ,
You can’t perform that action at this time.
0 commit comments