diff options
| author | luwenpeng <[email protected]> | 2024-10-25 19:15:28 +0800 |
|---|---|---|
| committer | luwenpeng <[email protected]> | 2024-10-25 19:15:45 +0800 |
| commit | 03864c9731ec87ed6c7e1fbe3c5f261880e857dc (patch) | |
| tree | 2b2343f491faf890889411b1a69a3f40b956e58f /test/lpi_plus | |
| parent | 4061d5a942392c4716586ded8c586440d2e920ca (diff) | |
Add state to the on_session_message parameter.
* When state is closed, it implies that packet is null and the session will be destroyed
Diffstat (limited to 'test/lpi_plus')
| -rw-r--r-- | test/lpi_plus/gtest_lpip_module.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/test/lpi_plus/gtest_lpip_module.c b/test/lpi_plus/gtest_lpip_module.c index abcbe61..49382a8 100644 --- a/test/lpi_plus/gtest_lpip_module.c +++ b/test/lpi_plus/gtest_lpip_module.c @@ -130,9 +130,14 @@ static void gtest_lpip_on_appid_msg(struct session *sess, enum APPID_ORIGIN orig return; } -static void on_session(struct session *sess, struct packet *pkt, void *args) +static void on_session(struct session *sess, enum session_state state, struct packet *pkt, void *args) { - if(sess==NULL || pkt==NULL || args==NULL)return; + if (state == SESSION_STATE_CLOSED) + { + assert(pkt == NULL); + return; + } + struct test_lpip_env *env = (struct test_lpip_env *)args; if (session_get_current_state(sess) == SESSION_STATE_OPENING) { |
