X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Ftlsopenssl%2Ftls_async.c;h=fdfcf3a6c527494a4f1630082aab8c6143f5ef9b;hb=ac267dd41be0265b23f2c1666e819994518e577a;hp=100a75b33327b4cac60d665d23384c1d575e7825;hpb=f4a92f6a1cf6b27318b6819ad3145b4020a27779;p=vpp.git diff --git a/src/plugins/tlsopenssl/tls_async.c b/src/plugins/tlsopenssl/tls_async.c index 100a75b3332..fdfcf3a6c52 100644 --- a/src/plugins/tlsopenssl/tls_async.c +++ b/src/plugins/tlsopenssl/tls_async.c @@ -251,8 +251,7 @@ tls_async_openssl_callback (SSL * s, void *cb_arg) int *evt_run_head = &om->queue[thread_index].evt_run_head; TLS_DBG (2, "Set event %d to run\n", event_index); - - event = openssl_evt_get (event_index); + event = openssl_evt_get_w_thread (event_index, thread_index); /* Happend when a recursive case, especially in SW simulation */ if (PREDICT_FALSE (event->status == SSL_ASYNC_READY)) @@ -303,6 +302,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 +321,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; }