diff options
| author | Qiuwen Lu <[email protected]> | 2017-06-01 14:36:21 +0800 |
|---|---|---|
| committer | Qiuwen Lu <[email protected]> | 2017-06-01 14:36:21 +0800 |
| commit | b4651f83fc63345dbe06c60f6655606979f3840f (patch) | |
| tree | 9a2d06977647e2cb71b2266948daae02df13502b /tunnat | |
| parent | 5195a74d2074ab59f46520e9d9d83a0dd885dc7e (diff) | |
增加rxonly示例程序回环收发包功能。增加session表删除表项时的统计。
Diffstat (limited to 'tunnat')
| -rw-r--r-- | tunnat/src/session.cc | 2 | ||||
| -rw-r--r-- | tunnat/test/TestSession.cc | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/tunnat/src/session.cc b/tunnat/src/session.cc index 86f4c0b..03723fe 100644 --- a/tunnat/src/session.cc +++ b/tunnat/src/session.cc @@ -94,6 +94,8 @@ int SessionTable::htable_comp_fun_cb(const uchar * key1, uint size1, const uchar int SessionTable::htable_free_fun_cb(void * data) { SessionEntry * ss_entry = (SessionEntry *)data; + + TUNNAT_THREAD_STAT_ADD(TUNNAT_STAT_SESSION_REMOVE, 1); delete ss_entry; return 0; }
\ No newline at end of file diff --git a/tunnat/test/TestSession.cc b/tunnat/test/TestSession.cc index bfaab16..55e2938 100644 --- a/tunnat/test/TestSession.cc +++ b/tunnat/test/TestSession.cc @@ -30,6 +30,7 @@ int SessionKeyGenerate(SessionKey & key) { key.s_in_addr.s_addr = rand(); key.d_in_addr.s_addr = rand(); + return 0; } TEST(TunnatSession, TunnatSessionRandomAddQuery) @@ -39,7 +40,6 @@ TEST(TunnatSession, TunnatSessionRandomAddQuery) const int expire_time = 0; const int rd_keys = 2048; - int ret = 0; SessionTable * ss_table = new SessionTable; ASSERT_EQ(ss_table->Init(nr_session, nr_slots, expire_time), 0); |
