Skip to content
4 changes: 2 additions & 2 deletions ACE/ace/ACE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2205,8 +2205,8 @@ ACE::handle_ready (ACE_HANDLE handle,
// Wait for data or for the timeout to elapse.
int select_width = 0;
#if !defined (ACE_WIN32)
select_width = int (handle) + 1;
# endif /* ACE_WIN32 */
select_width = handle + 1;
#endif /* ACE_WIN32 */
int result = ACE_OS::select (select_width,
read_ready ? handle_set.fdset () : 0, // read_fds.
write_ready ? handle_set.fdset () : 0, // write_fds.
Expand Down
3 changes: 1 addition & 2 deletions ACE/ace/SSL/SSL_Context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,6 @@ ACE_SSL_Context::dh_params (const char *file_name,

{
// Swiped from Rescorla's examples and the OpenSSL s_server.c app
DH * ret = nullptr;
BIO * bio = nullptr;

if ((bio = ::BIO_new_file (this->dh_params_.file_name (), "r")) == nullptr)
Expand All @@ -793,7 +792,7 @@ ACE_SSL_Context::dh_params (const char *file_name,
return -1;
}

ret = PEM_read_bio_DHparams (bio, nullptr, nullptr, nullptr);
DH * ret = PEM_read_bio_DHparams (bio, nullptr, nullptr, nullptr);
BIO_free (bio);

if (ret == nullptr)
Expand Down
6 changes: 5 additions & 1 deletion ACE/ace/SSL/SSL_SOCK_Acceptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,11 @@ ACE_SSL_SOCK_Acceptor::ssl_accept (ACE_SSL_SOCK_Stream &new_stream,
{
// 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,
int select_width = 0;
#if !defined (ACE_WIN32)
select_width = handle + 1;
#endif /* ACE_WIN32 */
status = ACE::select (select_width,
&rd_handle,
&wr_handle,
nullptr,
Expand Down
6 changes: 5 additions & 1 deletion ACE/ace/SSL/SSL_SOCK_Connector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,11 @@ ACE_SSL_SOCK_Connector::ssl_connect (ACE_SSL_SOCK_Stream &new_stream,
ACE_ASSERT (rd_handle.num_set () == 1 || wr_handle.num_set () == 1);

// Block indefinitely if timeout pointer is zero.
status = ACE::select (int (handle) + 1,
int select_width = 0;
#if !defined (ACE_WIN32)
select_width = handle + 1;
#endif /* ACE_WIN32 */
status = ACE::select (select_width,
&rd_handle,
&wr_handle,
nullptr,
Expand Down
7 changes: 6 additions & 1 deletion ACE/ace/SSL/SSL_SOCK_Stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,14 @@ ACE_SSL_SOCK_Stream::recvv (iovec *io_vec,

io_vec->iov_base = nullptr;

int select_width = 0;
#if !defined (ACE_WIN32)
select_width = this->get_handle () + 1;
#endif /* ACE_WIN32 */

// Check the status of the current socket.
switch (
ACE_OS::select (int (this->get_handle ()) + 1,
ACE_OS::select (select_width,
handle_set,
nullptr,
nullptr,
Expand Down
6 changes: 5 additions & 1 deletion ACE/ace/SSL/SSL_SOCK_Stream.inl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ ACE_SSL_SOCK_Stream::set_handle (ACE_HANDLE fd)
}
else
{
(void) ::SSL_set_fd (this->ssl_, (int) fd);
#if defined (ACE_WIN32)
(void) ::SSL_set_fd (this->ssl_, static_cast<int>((intptr_t)fd));
#else
(void) ::SSL_set_fd (this->ssl_, fd);
#endif
this->ACE_SSL_SOCK::set_handle (fd);
this->stream_.set_handle (fd);
}
Expand Down
3 changes: 1 addition & 2 deletions ACE/examples/C++NPv2/AC_Client_Logging_Daemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,7 @@ int AC_CLD_Connector::connect_svc_handler
#if defined (ACE_WIN32)
// ACE_WIN32 is the only platform where ACE_HANDLE is not an int.
// See ace/config-lite.h for the typedefs.
SSL_set_fd (ssl_,
reinterpret_cast<int> (svc_handler->get_handle ()));
SSL_set_fd (ssl_, static_cast<int> ((intptr_t)svc_handler->get_handle ()));
#else
SSL_set_fd (ssl_, svc_handler->get_handle ());
#endif /* ACE_WIN32 */
Expand Down
2 changes: 1 addition & 1 deletion ACE/examples/C++NPv2/AIO_Client_Logging_Daemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ int AIO_CLD_Connector::validate_connection
#if defined (ACE_WIN32)
// ACE_WIN32 is the only platform where ACE_HANDLE is not an int.
// See ace/config-lite.h for the typedefs.
SSL_set_fd (ssl_, reinterpret_cast<int> (result.connect_handle ()));
SSL_set_fd (ssl_, static_cast<int> ((intptr_t)result.connect_handle ()));
#else
SSL_set_fd (ssl_, result.connect_handle ());
#endif /* ACE_WIN32 */
Expand Down
2 changes: 1 addition & 1 deletion ACE/examples/C++NPv2/TPC_Logging_Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ int TPC_Logging_Acceptor::accept_svc_handler
#if defined (ACE_WIN32)
// ACE_WIN32 is the only platform where ACE_HANDLE is not an int.
// See ace/config-lite.h for the typedefs.
SSL_set_fd (ssl_, reinterpret_cast<int> (sh->get_handle ()));
SSL_set_fd (ssl_, static_cast<int> ((intptr_t)sh->get_handle ()));
#else
SSL_set_fd (ssl_, sh->get_handle ());
#endif /* ACE_WIN32 */
Expand Down
6 changes: 5 additions & 1 deletion ACE/examples/IPC_SAP/SSL_SAP/SSL-server-fancy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -552,8 +552,12 @@ Handler_Factory::handle_events ()
ACE_Time_Value timeout (ACE_DEFAULT_TIMEOUT);
fd_set temp = handles;

int select_width = 0;
#if !defined (ACE_WIN32)
select_width = this->oneway_acceptor_.get_handle () + 1;
#endif /* ACE_WIN32 */
int result =
ACE_OS::select (int (this->oneway_acceptor_.get_handle ()) + 1,
ACE_OS::select (select_width,
(fd_set *) &temp,
0,
0,
Expand Down
11 changes: 8 additions & 3 deletions ACE/examples/IPC_SAP/SSL_SAP/SSL-server-simple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,14 @@ run_event_loop (u_short port)
ACE_Time_Value timeout (ACE_DEFAULT_TIMEOUT);
ACE_Handle_Set temp = handle_set;

int maxfd = int(oneway_acceptor.get_handle ());
if (maxfd < int(twoway_acceptor.get_handle ()))
maxfd = int(twoway_acceptor.get_handle ());
int maxfd = 0;
#if !defined (ACE_WIN32)
maxfd = oneway_acceptor.get_handle ();
if (maxfd < twoway_acceptor.get_handle ())
{
maxfd = twoway_acceptor.get_handle ();
}
# endif /* ACE_WIN32 */
int result = ACE_OS::select (maxfd + 1,
(fd_set *) temp,
0,
Expand Down
10 changes: 5 additions & 5 deletions ACE/examples/IPC_SAP/SSL_SAP/SSL-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,11 +328,11 @@ run_event_loop (u_short port)
ACE_Time_Value timeout (ACE_DEFAULT_TIMEOUT);
ACE_Handle_Set temp = handle_set;

int result = ACE_OS::select (int (oneway_acceptor.get_handle ()) + 1,
(fd_set *) temp,
0,
0,
timeout);
int select_width = 0;
#if !defined (ACE_WIN32)
select_width = oneway_acceptor.get_handle () + 1;
#endif /* ACE_WIN32 */
int const result = ACE_OS::select (select_width, (fd_set *) temp, 0, 0, timeout);
if (result == -1)
ACE_ERROR ((LM_ERROR,
"(%P|%t) %p\n",
Expand Down
6 changes: 5 additions & 1 deletion ACE/protocols/ace/INet/SSL_Proxy_Connector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,11 @@ namespace ACE
ACE_ASSERT (rd_handle.num_set () == 1 || wr_handle.num_set () == 1);

// Block indefinitely if timeout pointer is zero.
status = ACE::select (int (handle) + 1,
int select_width = 0;
#if !defined (ACE_WIN32)
select_width = handle + 1;
#endif /* ACE_WIN32 */
status = ACE::select (select_width,
&rd_handle,
&wr_handle,
0,
Expand Down
Loading