aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-10-21 16:07:46 -0700
committerDave Barach <openvpp@barachs.net>2020-04-03 22:10:22 +0000
commit00e01d3e875bb18397ff81e0f58f9b468477f473 (patch)
tree277b9ce692a465644de5d3481b42e6cce6394f46 /src/vnet/session/session.c
parent39aa7a5202a6a875bd6f5d341cb07f19ab0bf51e (diff)
session: improve error reporting
Type: improvement Change-Id: I9dd850a1ce85b0adb5136233f176117e0ee38817 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/session.c')
-rw-r--r--src/vnet/session/session.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c
index 33514008dd0..ac29627548c 100644
--- a/src/vnet/session/session.c
+++ b/src/vnet/session/session.c
@@ -736,7 +736,8 @@ session_main_flush_all_enqueue_events (u8 transport_proto)
}
static inline int
-session_stream_connect_notify_inline (transport_connection_t * tc, u8 is_fail,
+session_stream_connect_notify_inline (transport_connection_t * tc,
+ session_error_t err,
session_state_t opened_state)
{
u32 opaque = 0, new_ti, new_si;
@@ -764,8 +765,8 @@ session_stream_connect_notify_inline (transport_connection_t * tc, u8 is_fail,
opaque = tc->s_index;
- if (is_fail)
- return app_worker_connect_notify (app_wrk, s, opaque);
+ if (err)
+ return app_worker_connect_notify (app_wrk, s, err, opaque);
s = session_alloc_for_connection (tc);
s->session_state = SESSION_STATE_CONNECTING;
@@ -773,10 +774,10 @@ session_stream_connect_notify_inline (transport_connection_t * tc, u8 is_fail,
new_si = s->session_index;
new_ti = s->thread_index;
- if (app_worker_init_connected (app_wrk, s))
+ if ((err = app_worker_init_connected (app_wrk, s)))
{
session_free (s);
- app_worker_connect_notify (app_wrk, 0, opaque);
+ app_worker_connect_notify (app_wrk, 0, err, opaque);
return -1;
}
@@ -784,7 +785,7 @@ session_stream_connect_notify_inline (transport_connection_t * tc, u8 is_fail,
s->session_state = opened_state;
session_lookup_add_connection (tc, session_handle (s));
- if (app_worker_connect_notify (app_wrk, s, opaque))
+ if (app_worker_connect_notify (app_wrk, s, SESSION_E_NONE, opaque))
{
s = session_get (new_si, new_ti);
session_free_w_fifos (s);
@@ -795,17 +796,17 @@ session_stream_connect_notify_inline (transport_connection_t * tc, u8 is_fail,
}
int
-session_stream_connect_notify (transport_connection_t * tc, u8 is_fail)
+session_stream_connect_notify (transport_connection_t * tc,
+ session_error_t err)
{
- return session_stream_connect_notify_inline (tc, is_fail,
- SESSION_STATE_READY);
+ return session_stream_connect_notify_inline (tc, err, SESSION_STATE_READY);
}
int
-session_ho_stream_connect_notify (transport_connection_t * tc, u8 is_fail)
+session_ho_stream_connect_notify (transport_connection_t * tc,
+ session_error_t err)
{
- return session_stream_connect_notify_inline (tc, is_fail,
- SESSION_STATE_OPENED);
+ return session_stream_connect_notify_inline (tc, err, SESSION_STATE_OPENED);
}
typedef struct _session_switch_pool_args
@@ -1116,7 +1117,7 @@ session_open_cl (u32 app_wrk_index, session_endpoint_t * rmt, u32 opaque)
sh = session_handle (s);
session_lookup_add_connection (tc, sh);
- return app_worker_connect_notify (app_wrk, s, opaque);
+ return app_worker_connect_notify (app_wrk, s, SESSION_E_NONE, opaque);
}
int