diff options
author | Ivan Shvedunov <ivan4th@gmail.com> | 2020-07-29 19:17:05 +0300 |
---|---|---|
committer | Ivan Shvedunov <ivan4th@gmail.com> | 2020-07-29 19:29:40 +0300 |
commit | 4c5343600d4fa4351816dd44a26c6a9b81e6b47e (patch) | |
tree | 7cb85f0936edce5e1ff290730d4e19676fcca1a0 /src/plugins/hs_apps | |
parent | e52eafd0471d7a6d2aca992d654786008d9a0f87 (diff) |
hsa: fix handling active connection failures in the proxy
Type: fix
Signed-off-by: Ivan Shvedunov <ivan4th@gmail.com>
Change-Id: I9c62bb6524247e2cd25de198263c16f3d9db0da9
Diffstat (limited to 'src/plugins/hs_apps')
-rw-r--r-- | src/plugins/hs_apps/proxy.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/src/plugins/hs_apps/proxy.c b/src/plugins/hs_apps/proxy.c index 6dd3f56ec57..9513fab20d9 100644 --- a/src/plugins/hs_apps/proxy.c +++ b/src/plugins/hs_apps/proxy.c @@ -434,21 +434,28 @@ active_open_connected_callback (u32 app_index, u32 opaque, proxy_session_t *ps; u8 thread_index = vlib_get_thread_index (); - if (err) - { - clib_warning ("connection %d failed!", opaque); - ASSERT (0); - return 0; - } - /* * Setup proxy session handle. */ clib_spinlock_lock_if_init (&pm->sessions_lock); ps = pool_elt_at_index (pm->sessions, opaque); - ps->vpp_active_open_handle = session_handle (s); - ps->active_open_establishing = 0; + + /* Connection failed */ + if (err) + { + vnet_disconnect_args_t _a, *a = &_a; + + a->handle = ps->vpp_server_handle; + a->app_index = pm->server_app_index; + vnet_disconnect_session (a); + ps->po_disconnected = 1; + } + else + { + ps->vpp_active_open_handle = session_handle (s); + ps->active_open_establishing = 0; + } /* Passive open session was already closed! */ if (ps->po_disconnected) |