session: use transport custom tx for app transports
Change-Id: I675f7090fa6b2ffdfb4ee748df858bfb7e39ce5a
Signed-off-by: Florin Coras <fcoras@cisco.com>
diff --git a/src/vnet/tls/tls.c b/src/vnet/tls/tls.c
index df5a068..ce62765 100644
--- a/src/vnet/tls/tls.c
+++ b/src/vnet/tls/tls.c
@@ -415,17 +415,6 @@
}
int
-tls_app_tx_callback (session_t * app_session)
-{
- tls_ctx_t *ctx;
- if (PREDICT_FALSE (app_session->session_state == SESSION_STATE_CLOSED))
- return 0;
- ctx = tls_ctx_get (app_session->connection_index);
- tls_ctx_write (ctx, app_session);
- return 0;
-}
-
-int
tls_app_rx_callback (session_t * tls_session)
{
tls_ctx_t *ctx;
@@ -501,7 +490,6 @@
.add_segment_callback = tls_add_segment_callback,
.del_segment_callback = tls_del_segment_callback,
.builtin_app_rx_callback = tls_app_rx_callback,
- .builtin_app_tx_callback = tls_app_tx_callback,
};
/* *INDENT-ON* */
@@ -663,6 +651,18 @@
return &ctx->connection;
}
+int
+tls_custom_tx_callback (void *session)
+{
+ session_t *app_session = (session_t *) session;
+ tls_ctx_t *ctx;
+ if (PREDICT_FALSE (app_session->session_state == SESSION_STATE_CLOSED))
+ return 0;
+ ctx = tls_ctx_get (app_session->connection_index);
+ tls_ctx_write (ctx, app_session);
+ return 0;
+}
+
u8 *
format_tls_ctx (u8 * s, va_list * args)
{
@@ -735,6 +735,7 @@
.stop_listen = tls_stop_listen,
.get_connection = tls_connection_get,
.get_listener = tls_listener_get,
+ .custom_tx = tls_custom_tx_callback,
.tx_type = TRANSPORT_TX_INTERNAL,
.service_type = TRANSPORT_SERVICE_APP,
.format_connection = format_tls_connection,