aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/tlsopenssl/tls_async.c
diff options
context:
space:
mode:
authorYu Ping <ping.yu@intel.com>2020-02-19 02:31:22 +0800
committerFlorin Coras <florin.coras@gmail.com>2020-02-19 02:56:43 +0000
commit837826169fd51c1d2bb7703e479447f5d4ffa9a5 (patch)
tree031c125e49ec8816f1d9a9eed81967c13a924b49 /src/plugins/tlsopenssl/tls_async.c
parentb9f1f1587504bc8c7db11ce637b20185588dbc16 (diff)
tls: handle disconect and reset in async mode
Type: fix When async is enabled and request is inflight, delay close oepration Change-Id: I713078fe9832c1599e8860fc0a6bb98588f20943 Signed-off-by: Yu Ping <ping.yu@intel.com>
Diffstat (limited to 'src/plugins/tlsopenssl/tls_async.c')
-rw-r--r--src/plugins/tlsopenssl/tls_async.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/plugins/tlsopenssl/tls_async.c b/src/plugins/tlsopenssl/tls_async.c
index 100a75b3332..86604667eb8 100644
--- a/src/plugins/tlsopenssl/tls_async.c
+++ b/src/plugins/tlsopenssl/tls_async.c
@@ -303,6 +303,18 @@ vpp_tls_async_init_event (tls_ctx_t * ctx,
return 1;
}
+int
+vpp_openssl_is_inflight (tls_ctx_t * ctx)
+{
+ u32 eidx;
+ openssl_evt_t *event;
+ eidx = ctx->evt_index;
+ event = openssl_evt_get (eidx);
+
+ if (event->status == SSL_ASYNC_INFLIGHT)
+ return 1;
+ return 0;
+}
int
vpp_tls_async_update_event (tls_ctx_t * ctx, int eagain)
@@ -310,13 +322,11 @@ vpp_tls_async_update_event (tls_ctx_t * ctx, int eagain)
u32 eidx;
openssl_evt_t *event;
+ eidx = ctx->evt_index;
+ event = openssl_evt_get (eidx);
+ event->status = SSL_ASYNC_INFLIGHT;
if (eagain)
- {
- eidx = ctx->evt_index;
- event = openssl_evt_get (eidx);
-
- return tls_async_openssl_callback (0, &event->cb_args);
- }
+ return tls_async_openssl_callback (0, &event->cb_args);
return 1;
}