session_main_t session_main;
+#if SESSION_DEBUG
+session_dbg_main_t session_dbg_main;
+#endif
+
static inline int
session_send_evt_to_thread (void *data, void *args, u32 thread_index,
session_evt_type_t evt_type)
s->session_state = SESSION_STATE_CREATED;
if ((rv = app_worker_init_accepted (s)))
- return rv;
+ {
+ session_free (s);
+ return rv;
+ }
session_lookup_add_connection (tc, session_handle (s));
if (notify)
{
app_worker_t *app_wrk = app_worker_get (s->app_wrk_index);
- return app_worker_accept_notify (app_wrk, s);
+ if ((rv = app_worker_accept_notify (app_wrk, s)))
+ {
+ session_lookup_del_session (s);
+ segment_manager_dealloc_fifos (s->rx_fifo, s->tx_fifo);
+ session_free (s);
+ return rv;
+ }
}
return 0;
app_wrk = app_worker_get (s->app_wrk_index);
if ((rv = app_worker_accept_notify (app_wrk, s)))
{
- session_free_w_fifos (s);
+ segment_manager_dealloc_fifos (s->rx_fifo, s->tx_fifo);
+ session_free (s);
return rv;
}
/* Enable transports */
transport_enable_disable (vm, 1);
+
+#if SESSION_DEBUG
+ session_dbg_main_t *sdm = &session_dbg_main;
+ vec_validate_aligned (sdm->wrk, num_threads - 1, CLIB_CACHE_LINE_BYTES);
+ int thread;
+ for (thread = 0; thread < num_threads; thread++)
+ {
+ clib_memset (&sdm->wrk[thread], 0, sizeof (session_dbg_evts_t));
+ }
+#endif /* SESSION_DEBUG */
+
return 0;
}