summaryrefslogtreecommitdiff
path: root/common/src/session_table.cpp
diff options
context:
space:
mode:
author刘畅 <[email protected]>2023-11-09 07:39:58 +0000
committer刘畅 <[email protected]>2023-11-09 07:39:58 +0000
commitf1c9565d486fe9a278996a3cfd8be6f77cf7a977 (patch)
tree0dff7a2c4a4f41ed2ddb0090dc52b2ede60c27fa /common/src/session_table.cpp
parent3e0e8c399905c65cd9638907f5d5e245f2c50a9a (diff)
parent0e780765553bbcf62fa604add488cca48d49ea03 (diff)
Merge branch 'optimize_performance' into 'rel'v1.3.7
性能优化 See merge request tango/shaping-engine!50
Diffstat (limited to 'common/src/session_table.cpp')
-rw-r--r--common/src/session_table.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/common/src/session_table.cpp b/common/src/session_table.cpp
index 0764e14..b5a2278 100644
--- a/common/src/session_table.cpp
+++ b/common/src/session_table.cpp
@@ -113,7 +113,7 @@ int session_table_insert(struct session_table *table, uint64_t session_id, const
HASH_FIND(hh1, table->root_by_id, &session_id, sizeof(session_id), temp);
if (temp)
{
- LOG_DEBUG("%s: insert: key %lu exists", LOG_TAG_STABLE, session_id);
+ LOG_ERROR("%s: insert: key %lu exists", LOG_TAG_STABLE, session_id);
return -1;
}
@@ -128,7 +128,7 @@ int session_table_insert(struct session_table *table, uint64_t session_id, const
HASH_ADD(hh1, table->root_by_id, session_id, sizeof(temp->session_id), temp);
HASH_ADD(hh2, table->root_by_addr, session_addr, sizeof(temp->session_addr), temp);
- LOG_DEBUG("%s: insert: key %lu success", LOG_TAG_STABLE, session_id);
+ //LOG_DEBUG("%s: insert: key %lu success", LOG_TAG_STABLE, session_id);
table->session_node_count++;
return 0;
@@ -140,7 +140,7 @@ int session_table_delete_by_id(struct session_table *table, uint64_t session_id)
HASH_FIND(hh1, table->root_by_id, &session_id, sizeof(session_id), temp);
if (!temp)
{
- LOG_DEBUG("%s: delete: key %lu not exists", LOG_TAG_STABLE, session_id);
+ LOG_ERROR("%s: delete: key %lu not exists", LOG_TAG_STABLE, session_id);
return -1;
}
@@ -156,7 +156,7 @@ int session_table_delete_by_id(struct session_table *table, uint64_t session_id)
free(temp);
temp = NULL;
- LOG_DEBUG("%s: delete: key %lu success", LOG_TAG_STABLE, session_id);
+ //LOG_DEBUG("%s: delete: key %lu success", LOG_TAG_STABLE, session_id);
table->session_node_count--;
return 0;
@@ -174,7 +174,7 @@ int session_table_delete_by_addr(struct session_table *table, const struct addr_
HASH_FIND(hh2, table->root_by_addr, &reverse_addr, sizeof(struct addr_tuple4), temp);
if (!temp)
{
- LOG_DEBUG("%s: delete: key %s not exists", LOG_TAG_STABLE, addr_str);
+ LOG_ERROR("%s: delete: key %s not exists", LOG_TAG_STABLE, addr_str);
free(addr_str);
return -1;
}
@@ -192,7 +192,7 @@ int session_table_delete_by_addr(struct session_table *table, const struct addr_
free(temp);
temp = NULL;
- LOG_DEBUG("%s: delete: key %s success", LOG_TAG_STABLE, addr_str);
+ //LOG_DEBUG("%s: delete: key %s success", LOG_TAG_STABLE, addr_str);
free(addr_str);
addr_str = NULL;
table->session_node_count--;
@@ -206,11 +206,11 @@ struct session_node *session_table_search_by_id(struct session_table *table, uin
HASH_FIND(hh1, table->root_by_id, &session_id, sizeof(session_id), temp);
if (!temp)
{
- LOG_DEBUG("%s: search: key %lu not exists", LOG_TAG_STABLE, session_id);
+ //LOG_DEBUG("%s: search: key %lu not exists", LOG_TAG_STABLE, session_id);
return NULL;
}
- LOG_DEBUG("%s: search: key %lu success", LOG_TAG_STABLE, session_id);
+ //LOG_DEBUG("%s: search: key %lu success", LOG_TAG_STABLE, session_id);
return temp;
}
@@ -227,14 +227,14 @@ struct session_node *session_table_search_by_addr(struct session_table *table, c
HASH_FIND(hh2, table->root_by_addr, &reverse_addr, sizeof(struct addr_tuple4), temp);
if (!temp)
{
- LOG_DEBUG("%s: search: key %s not exists", LOG_TAG_STABLE, addr_str);
+ //LOG_DEBUG("%s: search: key %s not exists", LOG_TAG_STABLE, addr_str);
free(addr_str);
addr_str = NULL;
return NULL;
}
}
- LOG_DEBUG("%s: search: key %s success", LOG_TAG_STABLE, addr_str);
+ //LOG_DEBUG("%s: search: key %s success", LOG_TAG_STABLE, addr_str);
free(addr_str);
addr_str = NULL;