bneradt commented on a change in pull request #7150:
URL: https://github.com/apache/trafficserver/pull/7150#discussion_r482327252



##########
File path: iocore/net/SSLNetVConnection.cc
##########
@@ -1224,42 +1230,30 @@ SSLNetVConnection::sslServerHandShakeEvent(int &err)
     } // Still data in the BIO
   }
 
-#if TS_USE_TLS_ASYNC
-  if (SSLConfigParams::async_handshake_enabled) {
-    SSL_set_mode(ssl, SSL_MODE_ASYNC);
-  }
-#endif
   ssl_error_t ssl_error = SSLAccept(ssl);
 #if TS_USE_TLS_ASYNC
   if (ssl_error == SSL_ERROR_WANT_ASYNC) {
-    size_t numfds;
-    OSSL_ASYNC_FD *waitfds;
-    // Set up the epoll entry for the signalling
-    if (SSL_get_all_async_fds(ssl, nullptr, &numfds) && numfds > 0) {
-      // Allocate space for the waitfd on the stack, should only be one most 
all of the time
-      waitfds = reinterpret_cast<OSSL_ASYNC_FD *>(alloca(sizeof(OSSL_ASYNC_FD) 
* numfds));
-      if (SSL_get_all_async_fds(ssl, waitfds, &numfds) && numfds > 0) {
-        // Temporarily disable regular net
-        this->read.triggered  = false;
-        this->write.triggered = false;
-        this->ep.stop(); // Modify used in read_disable doesn't work for edge 
triggered epol
-        // Have to have the read NetState enabled because we are using it for 
the signal vc
-        read.enabled       = true;
-        PollDescriptor *pd = get_PollDescriptor(this_ethread());
-        this->ep.start(pd, waitfds[0], static_cast<NetEvent *>(this), 
EVENTIO_READ);
-        this->ep.type = EVENTIO_READWRITE_VC;
+    // Do we need to set up the async eventfd?  Or is it already registered?
+    if (async_ep.fd < 0) {
+      size_t numfds;
+      OSSL_ASYNC_FD *waitfds;
+      // Set up the epoll entry for the signalling
+      if (SSL_get_all_async_fds(ssl, nullptr, &numfds) && numfds > 0) {
+        // Allocate space for the waitfd on the stack, should only be one most 
all of the time
+        waitfds = reinterpret_cast<OSSL_ASYNC_FD 
*>(alloca(sizeof(OSSL_ASYNC_FD) * numfds));

Review comment:
       It looks like the declaration of waitfds can be moved down to line 1243.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to