Skip to content

Commit 59cabde

Browse files
committed
Add log for table checking
1 parent fb6b556 commit 59cabde

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tc_mysql_module.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#define COM_QUERY 3
77
#define SEC_AUTH_PACKET_NUM 3
88
#define MAX_SP_SIZE 256
9+
#define MAX_TABLE_ITEM_NUM 1048576
910

1011
typedef struct {
1112
uint32_t req_begin:1;
@@ -128,6 +129,9 @@ check_pack_needed_for_recons(tc_sess_t *s, tc_iph_t *ip, tc_tcph_t *tcp)
128129
item->list = link_list_create(ctx.pool);
129130
if (item->list != NULL) {
130131
hash_add(ctx.table, ctx.pool, s->hash_key, item);
132+
if (ctx.table->total > MAX_TABLE_ITEM_NUM) {
133+
tc_log_info(LOG_INFO, 0, "too many items in ctx.table");
134+
}
131135
} else {
132136
tc_log_info(LOG_ERR, 0, "list create err");
133137
return false;

0 commit comments

Comments
 (0)