diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2020-06-30 08:24:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-30 08:24:35 +0200 |
commit | f082edff2b464aa48cbf7c4221e04b03a4e4e0fc (patch) | |
tree | a7bfe2599e5d3ecbd2c2940f5d70a286cd85ea43 | |
parent | c4abd2741c9addcbd210e5a5a9a89abca4529734 (diff) | |
download | ATCD-revert-1044-Replace-select-with-poll-in-SOCK-Connector-and-Acceptor.tar.gz |
Revert "Replacing use of ::select in favor of ::poll"revert-1044-Replace-select-with-poll-in-SOCK-Connector-and-Acceptor
-rw-r--r-- | ACE/ace/SSL/SSL_SOCK_Acceptor.cpp | 48 | ||||
-rw-r--r-- | ACE/ace/SSL/SSL_SOCK_Connector.cpp | 35 |
2 files changed, 3 insertions, 80 deletions
diff --git a/ACE/ace/SSL/SSL_SOCK_Acceptor.cpp b/ACE/ace/SSL/SSL_SOCK_Acceptor.cpp index 63f6d9bdc99..9ec3d58e9a2 100644 --- a/ACE/ace/SSL/SSL_SOCK_Acceptor.cpp +++ b/ACE/ace/SSL/SSL_SOCK_Acceptor.cpp @@ -10,11 +10,6 @@ #include "ace/Countdown_Time.h" #include "ace/Truncate.h" - -#if defined (ACE_HAS_POLL) -# include "ace/OS_NS_poll.h" -#endif /* ACE_HAS_POLL */ - #if !defined (__ACE_INLINE__) #include "SSL_SOCK_Acceptor.inl" #endif /* __ACE_INLINE__ */ @@ -69,16 +64,10 @@ ACE_SSL_SOCK_Acceptor::ssl_accept (ACE_SSL_SOCK_Stream &new_stream, int status; do { -#if defined (ACE_HAS_POLL) - struct pollfd fds; - ACE_OS::memset(&fds, 0, sizeof(fds)); - fds.revents = 0; -#else // These handle sets are used to set up for whatever SSL_accept // says it wants next. They're reset on each pass around the loop. ACE_Handle_Set rd_handle; ACE_Handle_Set wr_handle; -#endif /* ACE_HAS_POLL */ status = ::SSL_accept (ssl); switch (::SSL_get_error (ssl, status)) @@ -88,22 +77,12 @@ ACE_SSL_SOCK_Acceptor::ssl_accept (ACE_SSL_SOCK_Stream &new_stream, break; // Done case SSL_ERROR_WANT_WRITE: -#if defined (ACE_HAS_POLL) - fds.fd = handle; - fds.events = POLLOUT; -#else wr_handle.set_bit (handle); -#endif /* ACE_HAS_POLL */ status = 1; // Wait for more activity break; case SSL_ERROR_WANT_READ: -#if defined (ACE_HAS_POLL) - fds.fd = handle; - fds.events = POLLIN; -#else rd_handle.set_bit (handle); -#endif /* ACE_HAS_POLL */ status = 1; // Wait for more activity break; @@ -131,27 +110,11 @@ ACE_SSL_SOCK_Acceptor::ssl_accept (ACE_SSL_SOCK_Stream &new_stream, // Use that to decide what to do. status = 1; // Wait for more activity if (SSL_want_write (ssl)) - { -#if defined (ACE_HAS_POLL) - fds.fd = handle; - fds.events = POLLOUT; -#else - wr_handle.set_bit (handle); -#endif /* ACE_HAS_POLL */ - } + wr_handle.set_bit (handle); else if (SSL_want_read (ssl)) - { -#if defined (ACE_HAS_POLL) - fds.fd = handle; - fds.events = POLLIN; -#else - rd_handle.set_bit (handle); -#endif /* ACE_HAS_POLL */ - } + rd_handle.set_bit (handle); else - { - status = -1; // Doesn't want anything - bail out - } + status = -1; // Doesn't want anything - bail out } else status = -1; @@ -165,10 +128,6 @@ ACE_SSL_SOCK_Acceptor::ssl_accept (ACE_SSL_SOCK_Stream &new_stream, if (status == 1) { -#if defined (ACE_HAS_POLL) - ACE_ASSERT(fds.fd != 0); - status = ACE_OS::poll(&fds, 1, timeout); -#else // Must have at least one handle to wait for at this point. ACE_ASSERT (rd_handle.num_set() == 1 || wr_handle.num_set () == 1); status = ACE::select (int (handle) + 1, @@ -176,7 +135,6 @@ ACE_SSL_SOCK_Acceptor::ssl_accept (ACE_SSL_SOCK_Stream &new_stream, &wr_handle, 0, timeout); -#endif /* ACE_HAS_POLL */ (void) countdown.update (); diff --git a/ACE/ace/SSL/SSL_SOCK_Connector.cpp b/ACE/ace/SSL/SSL_SOCK_Connector.cpp index d85fd545d27..45df4ef0404 100644 --- a/ACE/ace/SSL/SSL_SOCK_Connector.cpp +++ b/ACE/ace/SSL/SSL_SOCK_Connector.cpp @@ -10,10 +10,6 @@ #include <openssl/err.h> -#if defined (ACE_HAS_POLL) -# include "ace/OS_NS_poll.h" -#endif /* ACE_HAS_POLL */ - #if !defined (__ACE_INLINE__) #include "SSL_SOCK_Connector.inl" #endif /* __ACE_INLINE__ */ @@ -75,16 +71,10 @@ ACE_SSL_SOCK_Connector::ssl_connect (ACE_SSL_SOCK_Stream &new_stream, do { -#if defined (ACE_HAS_POLL) - struct pollfd fds; - ACE_OS::memset(&fds, 0, sizeof(fds)); - fds.revents = 0; -#else // These handle sets are used to set up for whatever SSL_connect // says it wants next. They're reset on each pass around the loop. ACE_Handle_Set rd_handle; ACE_Handle_Set wr_handle; -#endif /* ACE_HAS_POLL */ status = ::SSL_connect (ssl); switch (::SSL_get_error (ssl, status)) @@ -96,22 +86,12 @@ ACE_SSL_SOCK_Connector::ssl_connect (ACE_SSL_SOCK_Stream &new_stream, break; // Done case SSL_ERROR_WANT_WRITE: -#if defined (ACE_HAS_POLL) - fds.fd = handle; - fds.events = POLLOUT; -#else wr_handle.set_bit (handle); -#endif /* ACE_HAS_POLL */ status = 1; // Wait for more activity break; case SSL_ERROR_WANT_READ: -#if defined (ACE_HAS_POLL) - fds.fd = handle; - fds.events = POLLIN; -#else rd_handle.set_bit (handle); -#endif /* ACE_HAS_POLL */ status = 1; // Wait for more activity break; @@ -140,21 +120,11 @@ ACE_SSL_SOCK_Connector::ssl_connect (ACE_SSL_SOCK_Stream &new_stream, status = 1; // Wait for more activity if (SSL_want_write (ssl)) { -#if defined (ACE_HAS_POLL) - fds.fd = handle; - fds.events = POLLOUT; -#else wr_handle.set_bit (handle); -#endif /* ACE_HAS_POLL */ } else if (SSL_want_read (ssl)) { -#if defined (ACE_HAS_POLL) - fds.fd = handle; - fds.events = POLLIN; -#else rd_handle.set_bit (handle); -#endif /* ACE_HAS_POLL */ } else { @@ -176,10 +146,6 @@ ACE_SSL_SOCK_Connector::ssl_connect (ACE_SSL_SOCK_Stream &new_stream, if (status == 1) { -#if defined (ACE_HAS_POLL) - ACE_ASSERT(fds.fd != 0); - status = ACE_OS::poll(&fds, 1, timeout); -#else // Must have at least one handle to wait for at this point. ACE_ASSERT (rd_handle.num_set () == 1 || wr_handle.num_set () == 1); @@ -189,7 +155,6 @@ ACE_SSL_SOCK_Connector::ssl_connect (ACE_SSL_SOCK_Stream &new_stream, &wr_handle, 0, (timeout == 0 ? 0 : &t)); -#endif /* ACE_HAS_POLL */ (void) countdown.update (); |