summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2017-04-05 15:48:51 +0200
committerJohnny Willemsen <jwillemsen@remedy.nl>2017-04-05 15:48:51 +0200
commit97602b478aa7f6310cccd3a351dc8c0fb132da7a (patch)
treed3cf01e7e0a19165fb8ea9da3f53ea63a5eaeb79
parent174494fc4b0d73da1cf12e574b0bc8bf216ce1d9 (diff)
parentd5cfdb41caf7feffc320fd53836905012dce1b55 (diff)
downloadATCD-97602b478aa7f6310cccd3a351dc8c0fb132da7a.tar.gz
Merge branch 'master' of git://github.com/DOCGroup/ATCD
-rw-r--r--ACE/ace/INET_Addr.cpp6
-rw-r--r--ACE/ace/TTY_IO.cpp13
-rw-r--r--ACE/tests/INET_Addr_Test.cpp19
-rw-r--r--ACE/tests/INET_Addr_Test_IPV6.cpp55
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Replication_Manager.cpp4
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Server.cpp4
-rw-r--r--TAO/orbsvcs/tests/FT_Naming/Replication/client.cpp36
7 files changed, 101 insertions, 36 deletions
diff --git a/ACE/ace/INET_Addr.cpp b/ACE/ace/INET_Addr.cpp
index a9b3649142d..811ee79afc6 100644
--- a/ACE/ace/INET_Addr.cpp
+++ b/ACE/ace/INET_Addr.cpp
@@ -371,6 +371,9 @@ ACE_INET_Addr::set (u_short port_number,
#endif /* ACE_HAS_IPV6 && ACE_USES_IPV4_IPV6_MIGRATION */
#ifdef ACE_HAS_IPV6
+ if (address_family == AF_UNSPEC && ACE::ipv6_enabled ())
+ address_family = AF_INET6;
+
if (address_family != AF_INET
&& ACE_OS::inet_pton (AF_INET6, host_name,
&this->inet_addr_.in6_.sin6_addr) == 1)
@@ -510,6 +513,9 @@ ACE_INET_Addr::set (const char port_name[],
}
int address_family = PF_UNSPEC;
+ if (ACE_OS::strcmp(protocol, "tcp") == 0)
+ address_family = AF_INET;
+
# if defined (ACE_HAS_IPV6)
if (ACE_OS::strcmp (protocol, "tcp6") == 0)
address_family = AF_INET6;
diff --git a/ACE/ace/TTY_IO.cpp b/ACE/ace/TTY_IO.cpp
index c9e14e966e2..53c56baddab 100644
--- a/ACE/ace/TTY_IO.cpp
+++ b/ACE/ace/TTY_IO.cpp
@@ -242,16 +242,24 @@ int ACE_TTY_IO::control (Control_Mode cmd, Serial_Params *arg) const
{
devpar.c_cflag |= PARENB;
devpar.c_cflag |= PARODD;
+ devpar.c_iflag &= ~IGNPAR;
+ devpar.c_iflag |= INPCK | PARMRK;
}
else if (ACE_OS::strcasecmp (arg->paritymode, ACE_TTY_IO_EVEN) == 0)
{
devpar.c_cflag |= PARENB;
devpar.c_cflag &= ~PARODD;
+ devpar.c_iflag &= ~IGNPAR;
+ devpar.c_iflag |= INPCK | PARMRK;
}
else if (ACE_OS::strcasecmp (arg->paritymode, ACE_TTY_IO_NONE) == 0)
- devpar.c_cflag &= ~PARENB;
+ {
+ devpar.c_cflag &= ~PARENB;
+ }
else
- return -1;
+ {
+ return -1;
+ }
}
else
{
@@ -291,7 +299,6 @@ int ACE_TTY_IO::control (Control_Mode cmd, Serial_Params *arg) const
devpar.c_cflag |= CLOCAL;
#endif /* CLOCAL */
- devpar.c_iflag = IGNPAR | INPCK;
if (arg->databits < 8)
devpar.c_iflag |= ISTRIP;
diff --git a/ACE/tests/INET_Addr_Test.cpp b/ACE/tests/INET_Addr_Test.cpp
index 816c2eb2b7d..6b389470032 100644
--- a/ACE/tests/INET_Addr_Test.cpp
+++ b/ACE/tests/INET_Addr_Test.cpp
@@ -390,14 +390,17 @@ int run_main (int, ACE_TCHAR *[])
{
ACE_INET_Addr addr;
int old_type = addr.get_type();
- addr.set(12345, ACE_TEXT ("localhost"));
- if (addr.get_type() != old_type) {
- ACE_ERROR ((LM_ERROR,
- ACE_TEXT ("IPv6 set failed: before addr.set(12345), addr.type() = %d\n")
- ACE_TEXT (" after addr.set(12345), addr.type() = %d\n"),
- old_type,
- addr.get_type ()));
- status = 1;
+ if (addr.set(12345, ACE_TEXT ("localhost")) == 0) {
+ if (addr.get_type() != old_type) {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("IPv6 set failed: addr.set(12345, \"localhost\"), old addr.type() = %d, new addr_type()= %d\n"),
+ old_type,
+ addr.get_type ()));
+ status = 1;
+ }
+ }
+ else {
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("IPv6 set failed: addr.set(12345, \"localhost\") returns nonzero\n")));
}
}
diff --git a/ACE/tests/INET_Addr_Test_IPV6.cpp b/ACE/tests/INET_Addr_Test_IPV6.cpp
index d9409bed5e8..e0522c126c1 100644
--- a/ACE/tests/INET_Addr_Test_IPV6.cpp
+++ b/ACE/tests/INET_Addr_Test_IPV6.cpp
@@ -22,7 +22,7 @@
// Make sure that ACE_Addr::addr_type_ is the same
// as the family of the inet_addr_.
-int check_type_consistency (const ACE_INET_Addr &addr)
+static int check_type_consistency (const ACE_INET_Addr &addr)
{
int family = -1;
@@ -51,6 +51,56 @@ int check_type_consistency (const ACE_INET_Addr &addr)
return 0;
}
+// A test to ensure ACE_INET_Addr can select the protocol family.
+static bool check_both_families()
+{
+ bool good = true;
+ ACE_INET_Addr a;
+ if (-1 == a.set(ACE_TEXT (""), ACE_TEXT ("www.google.com"), ACE_TEXT ("tcp")))
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("%p\n"),
+ ACE_TEXT ("both test 4, www.google.com")));
+ good = false;
+ }
+ else
+ {
+ ACE_TCHAR str[1000];
+ a.addr_to_string (str, 1000, 1);
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("got type %d, addr %s\n"), a.get_type(), str));
+ // Should have selected IPv4.
+ if (a.get_type() != AF_INET)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("Wrong address family, expecting IPv4\n")));
+ good = false;
+ }
+ }
+
+ ACE_INET_Addr b;
+ if (-1 == b.set(ACE_TEXT(""), ACE_TEXT("www.google.com"), ACE_TEXT("tcp6")))
+ {
+ ACE_ERROR((LM_ERROR,
+ ACE_TEXT("%p\n"),
+ ACE_TEXT("both test 6, www.google.com")));
+ good = false;
+ }
+ else
+ {
+ ACE_TCHAR str[1000];
+ b.addr_to_string(str, 1000, 1);
+ ACE_DEBUG((LM_DEBUG, ACE_TEXT("got type %d, addr %s\n"), b.get_type(), str));
+ // Should have selected IPv6.
+ if (b.get_type() != AF_INET6)
+ {
+ ACE_ERROR((LM_ERROR,
+ ACE_TEXT("Wrong address family, expecting IPv6\n")));
+ good = false;
+ }
+ }
+ return good;
+}
+
int run_main (int, ACE_TCHAR *[])
{
@@ -154,6 +204,9 @@ int run_main (int, ACE_TCHAR *[])
#endif /* ACE_LINUX */
}
+ if (!check_both_families())
+ status = 1;
+
#endif /* ACE_HAS_IPV6 */
ACE_END_TEST;
diff --git a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Replication_Manager.cpp b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Replication_Manager.cpp
index ce69843d5a6..ae540b2cd65 100644
--- a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Replication_Manager.cpp
+++ b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Replication_Manager.cpp
@@ -81,7 +81,9 @@ TAO_FT_Naming_Replication_Manager::TAO_FT_Naming_Replication_Manager (TAO_FT_Nam
to_send_ (10),
endpoint_ (owner.ft_endpoint ()),
update_delay_ (owner.ft_update_delay ()),
- replica_ior_ ()
+ replica_ior_ (),
+ send_combos_ (false),
+ refresh_peer_ (false)
{
}
diff --git a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Server.cpp b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Server.cpp
index 506d4efafde..af033e0e448 100644
--- a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Server.cpp
+++ b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Server.cpp
@@ -129,11 +129,11 @@ TAO_FT_Naming_Server::update_info (FT_Naming::UpdateInfoSeq &infos)
CORBA::ULong count = infos.length();
FT_Naming::UpdateInfo* guts = infos.get_buffer(true);
- FT_Naming::UpdateInfoSeq* block = 0;
+ FT_Naming::UpdateInfoSeq_var block = 0;
ACE_NEW(block, FT_Naming::UpdateInfoSeq (count,count,guts,true));
{
ACE_GUARD(TAO_SYNCH_MUTEX, guard, this->info_lock_);
- this->u_infos_.enqueue_tail (block);
+ this->u_infos_.enqueue_tail (block._retn());
}
this->orb_->orb_core ()->reactor ()->notify (&this->info_notifier_);
diff --git a/TAO/orbsvcs/tests/FT_Naming/Replication/client.cpp b/TAO/orbsvcs/tests/FT_Naming/Replication/client.cpp
index e8b2620e2a5..df15a22c8e5 100644
--- a/TAO/orbsvcs/tests/FT_Naming/Replication/client.cpp
+++ b/TAO/orbsvcs/tests/FT_Naming/Replication/client.cpp
@@ -218,7 +218,8 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[])
}
catch (const CosNaming::NamingContext::NotFound& ex)
{
- ex._tao_print_exception ("Unable to resolve object from replica.\n");
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT("Did not resolve object from replica on first.\n")));
// Try again...
try {
@@ -227,7 +228,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[])
// We did find the object on the replica, but only after a wait.
// This would be caused by a race condition to access the variable.
ACE_ERROR ((LM_ERROR,
- "Object appeared after a short wait.\n"));
+ ACE_TEXT("Object appeared after a short wait.\n")));
}
catch (const CosNaming::NamingContext::NotFound& second_ex)
{
@@ -290,7 +291,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[])
}
catch (const CosNaming::NamingContext::NotFound& ex)
{
- ex._tao_print_exception ("Unable to resolve wide context object from replica.\n");
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT("Unable to resolve wide context object from replica.\n")));
// Try again to see if it just was a race condition
try {
@@ -298,12 +299,12 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[])
root_context_2->resolve (wide);
// We did find the object on the replica, but only after a wait.
// This would be caused by a race condition to access the variable.
- ACE_ERROR ((LM_ERROR,
- "Object appeared after a short wait.\n"));
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("Object appeared after a short wait.\n")));
}
catch (const CosNaming::NamingContext::NotFound& second_ex)
{
- second_ex._tao_print_exception ("It really is not there. Failing...\n");
+ second_ex._tao_print_exception (ACE_TEXT ("It really is not there. Failing...\n"));
return -1;
}
}
@@ -411,7 +412,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[])
// Not on replica --- as it should be.
if (retried) // Was found on the retry
ACE_ERROR ((LM_ERROR,
- "Was removed after short wait.\n"));
+ ACE_TEXT("Was removed after short wait.\n")));
}
}
catch (const CORBA::Exception& ex)
@@ -441,9 +442,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[])
}
catch (const CORBA::Exception& ex)
{
- ex._tao_print_exception (
- ACE_TEXT (
- "Unable to resolve object from redundant server"));
+ ex._tao_print_exception (ACE_TEXT ("Unable to resolve object from redundant server"));
return -1;
}
@@ -499,8 +498,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[])
}
catch (const CORBA::Exception& ex)
{
- ex._tao_print_exception (
- ACE_TEXT ("Unexpected Exception received.\n"));
+ ex._tao_print_exception (ACE_TEXT ("Unexpected Exception received.\n"));
return -1;
}
@@ -524,8 +522,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[])
}
catch (const CORBA::Exception& ex)
{
- ex._tao_print_exception (
- ACE_TEXT ("Unexpected Exception received.\n"));
+ ex._tao_print_exception (ACE_TEXT ("Unexpected Exception received.\n"));
return -1;
}
@@ -581,8 +578,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[])
catch (const CORBA::Exception& ex)
{
ex._tao_print_exception (
- ACE_TEXT (
- "Unable to resolve deep context from redundant server"));
+ ACE_TEXT ("Unable to resolve deep context from redundant server"));
return -1;
}
@@ -629,8 +625,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[])
ACE_UINT32 usecs = ACE_UINT32(elapsed_time / gsf);
double secs = usecs / 1000000.0;
- ACE_DEBUG ((LM_DEBUG,
- "Bound %i objects in %.2f secs\n",
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Bound %i objects in %.2f secs\n"),
test_runs, secs));
// Test how long it takes to resolve
@@ -650,7 +645,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[])
secs = ((ACE_INT32) usecs) / 1000000.0;
ACE_DEBUG ((LM_DEBUG,
- "Resolved %i objects in %.2f secs\n",
+ ACE_TEXT ("Resolved %i objects in %.2f secs\n"),
test_runs, secs));
// Test how long it takes to unbind
@@ -669,8 +664,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[])
usecs = ACE_UINT32(elapsed_time / gsf);
secs = ((ACE_INT32) usecs) / 1000000.0;
- ACE_DEBUG ((LM_DEBUG,
- "Unbound %i objects in %.2f secs\n",
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT("Unbound %i objects in %.2f secs\n"),
test_runs, secs));