tls: Make tls CPS test run for a quite long time 10/24210/4
authorYu Ping <ping.yu@intel.com>
Mon, 6 Jan 2020 20:02:55 +0000 (04:02 +0800)
committerFlorin Coras <florin.coras@gmail.com>
Tue, 7 Jan 2020 15:12:48 +0000 (15:12 +0000)
Type: fix

Change-Id: I8cfb48bd7f92689b296861dd368186408918061b
Signed-off-by: Yu Ping <ping.yu@intel.com>
src/plugins/tlsopenssl/tls_openssl.c

index eeeb749..3dece6e 100644 (file)
@@ -424,8 +424,10 @@ openssl_ctx_read (tls_ctx_t * ctx, session_t * tls_session)
 
   if (PREDICT_FALSE (SSL_in_init (oc->ssl)))
     {
-      openssl_ctx_handshake_rx (ctx, tls_session);
-      return 0;
+      if (openssl_ctx_handshake_rx (ctx, tls_session) < 0)
+       return 0;
+      else
+       goto check_app_fifo;
     }
 
   f = tls_session->rx_fifo;
@@ -487,7 +489,9 @@ check_app_fifo:
        svm_fifo_enqueue_nocopy (f, read);
     }
 
-  tls_notify_app_enqueue (ctx, app_session);
+  /* If handshake just completed, session may still be in accepting state */
+  if (app_session->session_state >= SESSION_STATE_READY)
+    tls_notify_app_enqueue (ctx, app_session);
   if (SSL_pending (oc->ssl) > 0)
     tls_add_vpp_q_builtin_rx_evt (tls_session);