diff options
Diffstat (limited to 'src/vnet/session')
-rw-r--r-- | src/vnet/session/application.h | 2 | ||||
-rw-r--r-- | src/vnet/session/application_worker.c | 16 | ||||
-rw-r--r-- | src/vnet/session/session.c | 8 | ||||
-rw-r--r-- | src/vnet/session/session_node.c | 4 |
4 files changed, 21 insertions, 9 deletions
diff --git a/src/vnet/session/application.h b/src/vnet/session/application.h index ebb3cf57a71..3e1590ecb9f 100644 --- a/src/vnet/session/application.h +++ b/src/vnet/session/application.h @@ -222,6 +222,8 @@ int app_worker_accept_notify (app_worker_t * app_wrk, session_t * s); int app_worker_init_connected (app_worker_t * app_wrk, session_t * s); int app_worker_connect_notify (app_worker_t * app_wrk, session_t * s, u32 opaque); +int app_worker_close_notify (app_worker_t * app_wrk, session_t * s); +int app_worker_builtin_rx (app_worker_t * app_wrk, session_t * s); segment_manager_t *app_worker_get_listen_segment_manager (app_worker_t *, session_t *); segment_manager_t *app_worker_get_connect_segment_manager (app_worker_t *); diff --git a/src/vnet/session/application_worker.c b/src/vnet/session/application_worker.c index 85a6fede429..6b294ecf3fb 100644 --- a/src/vnet/session/application_worker.c +++ b/src/vnet/session/application_worker.c @@ -322,6 +322,22 @@ app_worker_connect_notify (app_worker_t * app_wrk, session_t * s, u32 opaque) } int +app_worker_close_notify (app_worker_t * app_wrk, session_t * s) +{ + application_t *app = application_get (app_wrk->app_index); + app->cb_fns.session_disconnect_callback (s); + return 0; +} + +int +app_worker_builtin_rx (app_worker_t * app_wrk, session_t * s) +{ + application_t *app = application_get (app_wrk->app_index); + app->cb_fns.builtin_app_rx_callback (s); + return 0; +} + +int app_worker_own_session (app_worker_t * app_wrk, session_t * s) { segment_manager_t *sm; diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c index 0a294dc6be1..c9eea1d2aad 100644 --- a/src/vnet/session/session.c +++ b/src/vnet/session/session.c @@ -715,18 +715,14 @@ void session_transport_closing_notify (transport_connection_t * tc) { app_worker_t *app_wrk; - application_t *app; session_t *s; s = session_get (tc->s_index, tc->thread_index); if (s->session_state >= SESSION_STATE_TRANSPORT_CLOSING) return; s->session_state = SESSION_STATE_TRANSPORT_CLOSING; - app_wrk = app_worker_get_if_valid (s->app_wrk_index); - if (!app_wrk) - return; - app = application_get (app_wrk->app_index); - app->cb_fns.session_disconnect_callback (s); + app_wrk = app_worker_get (s->app_wrk_index); + app_worker_close_notify (app_wrk, s); } /** diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c index a7ff2144533..81679477472 100644 --- a/src/vnet/session/session_node.c +++ b/src/vnet/session/session_node.c @@ -856,7 +856,6 @@ session_queue_node_fn (vlib_main_t * vm, vlib_node_runtime_t * node, f64 now = vlib_time_now (vm); int n_tx_packets = 0, i, rv; app_worker_t *app_wrk; - application_t *app; svm_msg_q_t *mq; void (*fp) (void *); @@ -973,8 +972,7 @@ session_queue_node_fn (vlib_main_t * vm, vlib_node_runtime_t * node, continue; svm_fifo_unset_event (s->rx_fifo); app_wrk = app_worker_get (s->app_wrk_index); - app = application_get (app_wrk->app_index); - app->cb_fns.builtin_app_rx_callback (s); + app_worker_builtin_rx (app_wrk, s); break; case SESSION_IO_EVT_BUILTIN_TX: s = session_get_from_handle_if_valid (e->session_handle); |