aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session-apps
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/session-apps')
-rw-r--r--src/vnet/session-apps/echo_client.c13
-rw-r--r--src/vnet/session-apps/echo_server.c8
-rw-r--r--src/vnet/session-apps/http_server.c9
3 files changed, 22 insertions, 8 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;
diff --git a/src/vnet/session-apps/echo_server.c b/src/vnet/session-apps/echo_server.c
index e79e8380fe5..c0fdb131603 100644
--- a/src/vnet/session-apps/echo_server.c
+++ b/src/vnet/session-apps/echo_server.c
@@ -73,7 +73,7 @@ void
echo_server_session_disconnect_callback (stream_session_t * s)
{
echo_server_main_t *esm = &echo_server_main;
- vnet_disconnect_args_t _a, *a = &_a;
+ vnet_disconnect_args_t _a = { 0 }, *a = &_a;
a->handle = session_handle (s);
a->app_index = esm->app_index;
@@ -83,8 +83,12 @@ echo_server_session_disconnect_callback (stream_session_t * s)
void
echo_server_session_reset_callback (stream_session_t * s)
{
+ echo_server_main_t *esm = &echo_server_main;
+ vnet_disconnect_args_t _a = { 0 }, *a = &_a;
clib_warning ("Reset session %U", format_stream_session, s, 2);
- stream_session_cleanup (s);
+ a->handle = session_handle (s);
+ a->app_index = esm->app_index;
+ vnet_disconnect_session (a);
}
int
diff --git a/src/vnet/session-apps/http_server.c b/src/vnet/session-apps/http_server.c
index 37441bb2188..d5e0ed98e08 100644
--- a/src/vnet/session-apps/http_server.c
+++ b/src/vnet/session-apps/http_server.c
@@ -435,7 +435,7 @@ static void
http_server_session_disconnect_callback (stream_session_t * s)
{
http_server_main_t *bsm = &http_server_main;
- vnet_disconnect_args_t _a, *a = &_a;
+ vnet_disconnect_args_t _a = { 0 }, *a = &_a;
a->handle = session_handle (s);
a->app_index = bsm->app_index;
@@ -445,8 +445,11 @@ http_server_session_disconnect_callback (stream_session_t * s)
static void
http_server_session_reset_callback (stream_session_t * s)
{
- clib_warning ("called.. ");
- stream_session_cleanup (s);
+ http_server_main_t *htm = &http_server_main;
+ vnet_disconnect_args_t _a = { 0 }, *a = &_a;
+ a->handle = session_handle (s);
+ a->app_index = htm->app_index;
+ vnet_disconnect_session (a);
}
static int