summaryrefslogtreecommitdiffstats
path: root/src/vnet/tls
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/tls')
-rw-r--r--src/vnet/tls/tls.c27
-rw-r--r--src/vnet/tls/tls.h3
2 files changed, 21 insertions, 9 deletions
diff --git a/src/vnet/tls/tls.c b/src/vnet/tls/tls.c
index d0552dc6f3b..89dbd36bc44 100644
--- a/src/vnet/tls/tls.c
+++ b/src/vnet/tls/tls.c
@@ -307,13 +307,13 @@ tls_ctx_init_client (tls_ctx_t * ctx)
}
static inline int
-tls_ctx_write (tls_ctx_t * ctx, session_t * app_session, u32 max_burst_size)
+tls_ctx_write (tls_ctx_t * ctx, session_t * app_session,
+ transport_send_params_t * sp)
{
- u32 max_write, n_wrote;
+ u32 n_wrote;
- max_write = max_burst_size * TRANSPORT_PACER_MIN_MSS;
- n_wrote = tls_vfts[ctx->tls_ctx_engine].ctx_write (ctx, app_session,
- max_write);
+ sp->max_burst_size = sp->max_burst_size * TRANSPORT_PACER_MIN_MSS;
+ n_wrote = tls_vfts[ctx->tls_ctx_engine].ctx_write (ctx, app_session, sp);
return n_wrote > 0 ? clib_max (n_wrote / TRANSPORT_PACER_MIN_MSS, 1) : 0;
}
@@ -448,6 +448,17 @@ tls_app_rx_callback (session_t * tls_session)
}
int
+tls_app_tx_callback (session_t * tls_session)
+{
+ tls_ctx_t *ctx;
+
+ ctx = tls_ctx_get (tls_session->opaque);
+ transport_connection_reschedule (&ctx->connection);
+
+ return 0;
+}
+
+int
tls_session_connected_callback (u32 tls_app_index, u32 ho_ctx_index,
session_t * tls_session, session_error_t err)
{
@@ -524,6 +535,7 @@ static session_cb_vft_t tls_app_cb_vft = {
.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,
.session_cleanup_callback = tls_app_session_cleanup,
};
/* *INDENT-ON* */
@@ -712,7 +724,7 @@ tls_listener_get (u32 listener_index)
}
int
-tls_custom_tx_callback (void *session, u32 max_burst_size)
+tls_custom_tx_callback (void *session, transport_send_params_t * sp)
{
session_t *app_session = (session_t *) session;
tls_ctx_t *ctx;
@@ -722,8 +734,7 @@ tls_custom_tx_callback (void *session, u32 max_burst_size)
return 0;
ctx = tls_ctx_get (app_session->connection_index);
- tls_ctx_write (ctx, app_session, max_burst_size);
- return 0;
+ return tls_ctx_write (ctx, app_session, sp);
}
u8 *
diff --git a/src/vnet/tls/tls.h b/src/vnet/tls/tls.h
index 2d09b291aa7..d950fe82629 100644
--- a/src/vnet/tls/tls.h
+++ b/src/vnet/tls/tls.h
@@ -110,7 +110,8 @@ typedef struct tls_engine_vft_
int (*ctx_init_client) (tls_ctx_t * ctx);
int (*ctx_init_server) (tls_ctx_t * ctx);
int (*ctx_read) (tls_ctx_t * ctx, session_t * tls_session);
- int (*ctx_write) (tls_ctx_t * ctx, session_t * app_session, u32 max_write);
+ int (*ctx_write) (tls_ctx_t * ctx, session_t * app_session,
+ transport_send_params_t * sp);
u8 (*ctx_handshake_is_over) (tls_ctx_t * ctx);
int (*ctx_start_listen) (tls_ctx_t * ctx);
int (*ctx_stop_listen) (tls_ctx_t * ctx);