summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2020-06-29 21:03:23 +0200
committerGitHub <noreply@github.com>2020-06-29 21:03:23 +0200
commitc4abd2741c9addcbd210e5a5a9a89abca4529734 (patch)
treeecba041b80ad23621cba95cf96a272e4b51f92bf
parent885ffbb0d51c93cec57ff50433ad95e8b79e6a32 (diff)
parentc61e51e5d135a2950fba52e7fc55983f2b46ef28 (diff)
downloadATCD-c4abd2741c9addcbd210e5a5a9a89abca4529734.tar.gz
Merge pull request #1145 from jwillemsen/jwi-handlereadybool
Changed ready flags of ACE::handle_ready from int to bool
-rw-r--r--ACE/ace/ACE.cpp6
-rw-r--r--ACE/ace/ACE.h7
-rw-r--r--ACE/ace/ACE.inl6
-rw-r--r--ACE/ace/Cached_Connect_Strategy_T.cpp14
-rw-r--r--ACE/ace/SSL/SSL_SOCK_Stream.inl2
-rw-r--r--ACE/tests/SOCK_Test.cpp9
6 files changed, 21 insertions, 23 deletions
diff --git a/ACE/ace/ACE.cpp b/ACE/ace/ACE.cpp
index 146881f0c7c..0ff5080d688 100644
--- a/ACE/ace/ACE.cpp
+++ b/ACE/ace/ACE.cpp
@@ -2191,9 +2191,9 @@ ACE::writev_n (ACE_HANDLE handle,
int
ACE::handle_ready (ACE_HANDLE handle,
const ACE_Time_Value *timeout,
- int read_ready,
- int write_ready,
- int exception_ready)
+ bool read_ready,
+ bool write_ready,
+ bool exception_ready)
{
#if defined (ACE_HAS_POLL)
ACE_UNUSED_ARG (exception_ready);
diff --git a/ACE/ace/ACE.h b/ACE/ace/ACE.h
index 71136301974..d10dc6710d1 100644
--- a/ACE/ace/ACE.h
+++ b/ACE/ace/ACE.h
@@ -726,9 +726,9 @@ namespace ACE
/// @retval 1 the handle is ready
extern ACE_Export int handle_ready (ACE_HANDLE handle,
const ACE_Time_Value *timeout,
- int read_ready,
- int write_ready,
- int exception_ready);
+ bool read_ready,
+ bool write_ready,
+ bool exception_ready);
/// Wait for @a timeout before proceeding to a @c recv operation.
/// @a val keeps track of whether we're in non-blocking mode or
@@ -877,7 +877,6 @@ namespace ACE
int iovcnt,
const ACE_Time_Value *timeout,
size_t *bytes_transferred);
-
}
// Close versioned namespace, if enabled by the user.
diff --git a/ACE/ace/ACE.inl b/ACE/ace/ACE.inl
index fcb1902f222..4e7a77e5d87 100644
--- a/ACE/ace/ACE.inl
+++ b/ACE/ace/ACE.inl
@@ -236,19 +236,19 @@ ACE::recv_i (ACE_HANDLE handle, void *buf, size_t len)
ACE_INLINE int
ACE::handle_read_ready (ACE_HANDLE handle, const ACE_Time_Value *timeout)
{
- return ACE::handle_ready (handle, timeout, 1, 0, 0);
+ return ACE::handle_ready (handle, timeout, true, false, false);
}
ACE_INLINE int
ACE::handle_write_ready (ACE_HANDLE handle, const ACE_Time_Value *timeout)
{
- return ACE::handle_ready (handle, timeout, 0, 1, 0);
+ return ACE::handle_ready (handle, timeout, false, true, false);
}
ACE_INLINE int
ACE::handle_exception_ready (ACE_HANDLE handle, const ACE_Time_Value *timeout)
{
- return ACE::handle_ready (handle, timeout, 0, 0, 1);
+ return ACE::handle_ready (handle, timeout, false, false, true);
}
ACE_INLINE void
diff --git a/ACE/ace/Cached_Connect_Strategy_T.cpp b/ACE/ace/Cached_Connect_Strategy_T.cpp
index 7a563edeeff..7987655b4d1 100644
--- a/ACE/ace/Cached_Connect_Strategy_T.cpp
+++ b/ACE/ace/Cached_Connect_Strategy_T.cpp
@@ -155,12 +155,12 @@ ACE_Cached_Connect_Strategy_Ex<SVC_HANDLER, ACE_PEER_CONNECTOR_2, CACHING_STRATE
sh = entry->int_id_.first;
// Is the connection clean?
- int state_result =
+ int const state_result =
ACE::handle_ready (sh->peer ().get_handle (),
&ACE_Time_Value::zero,
- 1, // read ready
- 0, // write ready
- 1);// exception ready
+ true, // read ready
+ false, // write ready
+ true);// exception ready
if (state_result == 1)
{
@@ -607,9 +607,9 @@ ACE_Bounded_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, CACHING_S
// Is the connection clean?
int state_result= ACE::handle_ready (sh->peer ().get_handle (),
&ACE_Time_Value::zero,
- 1, // read ready
- 0, // write ready
- 1);// exception ready
+ true, // read ready
+ false, // write ready
+ true);// exception ready
if (state_result == 1)
{
diff --git a/ACE/ace/SSL/SSL_SOCK_Stream.inl b/ACE/ace/SSL/SSL_SOCK_Stream.inl
index 7e9420bfb73..558be3e6628 100644
--- a/ACE/ace/SSL/SSL_SOCK_Stream.inl
+++ b/ACE/ace/SSL/SSL_SOCK_Stream.inl
@@ -164,7 +164,7 @@ ACE_SSL_SOCK_Stream::recv_i (void *buf,
timeout,
status == SSL_ERROR_WANT_READ,
status == SSL_ERROR_WANT_WRITE,
- 0);
+ false);
if (substat == 1) // Now ready to proceed
{
retry = true;
diff --git a/ACE/tests/SOCK_Test.cpp b/ACE/tests/SOCK_Test.cpp
index 39f582e1857..e3405eaeabe 100644
--- a/ACE/tests/SOCK_Test.cpp
+++ b/ACE/tests/SOCK_Test.cpp
@@ -66,15 +66,14 @@ client (void *arg)
const ACE_Time_Value def_timeout (ACE_DEFAULT_TIMEOUT);
ACE_Time_Value tv (def_timeout);
int result = ACE::handle_ready (cli_stream.get_handle (), &tv,
- 1, // read_ready
- 1, // write_ready
- 0);
- // we expect the handle to be at leat write_ready since it is freshly connected.
+ true, // read_ready
+ true, // write_ready
+ false);
+ // we expect the handle to be at least write_ready since it is freshly connected.
if (result == -1)
ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("(%P|%t) %p\n"), ACE_TEXT ("ACE::handle_ready")), 0);
// Send data to server (correctly handles "incomplete writes").
-
for (const char *c = ACE_ALPHABET; *c != '\0'; c++)
if (cli_stream.send_n (c, 1) == -1)
ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%P|%t) %p\n"), ACE_TEXT ("send_n")));