diff options
author | Florin Coras <fcoras@cisco.com> | 2018-12-04 09:21:36 -0800 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2018-12-05 15:36:46 +0000 |
commit | 4af830cd7b4a11bb84840183f7eebd6fb43497a6 (patch) | |
tree | 3a47abfae6a651a4be8f5c6a6cb180399c90db62 /src/vnet/session-apps/echo_client.c | |
parent | 01fdbcca130a6575712de99e26f46e21da432d40 (diff) |
session/tcp: postpone cleanup on reset
Change-Id: I45fd7538853f84c6c8bf804cc20acbc9601db3ba
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session-apps/echo_client.c')
-rw-r--r-- | src/vnet/session-apps/echo_client.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/vnet/session-apps/echo_client.c b/src/vnet/session-apps/echo_client.c index 51a85c068f8..d100aae5c2a 100644 --- a/src/vnet/session-apps/echo_client.c +++ b/src/vnet/session-apps/echo_client.c @@ -424,9 +424,15 @@ echo_clients_session_connected_callback (u32 app_index, u32 api_context, static void echo_clients_session_reset_callback (stream_session_t * s) { + echo_client_main_t *ecm = &echo_client_main; + vnet_disconnect_args_t _a = { 0 }, *a = &_a; + if (s->session_state == SESSION_STATE_READY) clib_warning ("Reset active connection %U", format_stream_session, s, 2); - stream_session_cleanup (s); + + a->handle = session_handle (s); + a->app_index = ecm->app_index; + vnet_disconnect_session (a); return; } @@ -440,7 +446,7 @@ static void echo_clients_session_disconnect_callback (stream_session_t * s) { echo_client_main_t *ecm = &echo_client_main; - vnet_disconnect_args_t _a, *a = &_a; + vnet_disconnect_args_t _a = { 0 }, *a = &_a; a->handle = session_handle (s); a->app_index = ecm->app_index; vnet_disconnect_session (a); @@ -451,7 +457,7 @@ void echo_clients_session_disconnect (stream_session_t * s) { echo_client_main_t *ecm = &echo_client_main; - vnet_disconnect_args_t _a, *a = &_a; + vnet_disconnect_args_t _a = { 0 }, *a = &_a; a->handle = session_handle (s); a->app_index = ecm->app_index; vnet_disconnect_session (a); @@ -552,6 +558,7 @@ echo_clients_detach () int rv; da->app_index = ecm->app_index; + da->api_client_index = ~0; rv = vnet_application_detach (da); ecm->test_client_attached = 0; ecm->app_index = ~0; |