summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Mesnier <mesnier_p@ociweb.com>2008-06-27 14:59:14 +0000
committerPhil Mesnier <mesnier_p@ociweb.com>2008-06-27 14:59:14 +0000
commitefede4024075b823cdffefab7e7dd7bd2a4ab893 (patch)
treea904bd60338b20094dfaa65da4e180b7fa63542b
parent6f4e3bb255fa4d2cd68ae99327365523ff1a0623 (diff)
downloadATCD-efede4024075b823cdffefab7e7dd7bd2a4ab893.tar.gz
Fri Jun 27 14:48:54 UTC 2008 Phil Mesnier <mesnier_p@ociweb.com>
-rw-r--r--TAO/ChangeLog20
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventConsumer_i.cpp45
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventSupplierMain.cpp15
-rw-r--r--TAO/tao/Acceptor_Registry.cpp64
-rw-r--r--TAO/tao/IIOP_Acceptor.cpp9
5 files changed, 103 insertions, 50 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index 0bb722b1ec1..f362a02ac6b 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,21 @@
+Fri Jun 27 14:48:54 UTC 2008 Phil Mesnier <mesnier_p@ociweb.com>
+
+
+ * orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventConsumer_i.cpp:
+ * orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventSupplierMain.cpp:
+
+ Fix the test for cases when TAO_LACKS_EVENT_CHANNEL_ANY is defined.
+
+ * tao/Acceptor_Registry.cpp:
+ * tao/IIOP_Acceptor.cpp:
+
+ Allow TAO to work on win32 hosts with only IPv4 when TAO is built
+ with ACE_HAS_IPV6 and ACE_USES_IPV4_IPV6_MIGRATION both set. The
+ migration flag is intended to make ACE/TAO test if IPv6 is enabled
+ at runtime, and to work without it. However, when TAO was required
+ to default its endpoint, it insisted on making an IPv6 endpoint
+ regardless of the enablement. This fix resolves bug 3353.
+
Fri Jun 27 12:55:00 UTC 2008 Simon Massey <sma at prismtech dot com>
* orbsvcs/tests/AVStreams/Pluggable/ftp.h:
@@ -168,7 +186,7 @@ Thu Jun 26 11:04:00 UTC 2008 Simon Massey <sma at prismtech dot com>
Thu Jun 26 02:37:59 UTC 2008 Phil Mesnier <mesnier_p@ociweb.com>
* tao/Messaging/AMH_Response_Handler.cpp:
-
+
Set the outbound GIOP version number to the correct value when
sending a response from an AMH servant. The problem is that there
are too many output CDR instances and AMH response handler uses
diff --git a/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventConsumer_i.cpp b/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventConsumer_i.cpp
index f6b8acd6dfe..10c7ff35b06 100644
--- a/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventConsumer_i.cpp
+++ b/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventConsumer_i.cpp
@@ -22,27 +22,38 @@ EchoEventConsumer_i::EchoEventConsumer_i(CORBA::ORB_ptr orb, int event_limit)
void EchoEventConsumer_i::push(const RtecEventComm::EventSet& events)
{
// Loop through the events, looking for shutdown events.
- for (u_int i = 0; i < events.length (); ++i) {
- //ACE_OS::printf(".");
- // Extract event data from the any.
- const char* eventData;
- std::ostringstream out;
+ for (u_int i = 0; i < events.length (); ++i)
+ {
+ //ACE_OS::printf(".");
+ // Extract event data from the any.
+ const char* eventData;
+ std::ostringstream out;
#ifndef ACE_LACKS_GETPID
- out << "[" << ACE_OS::getpid();
+ out << "[" << ACE_OS::getpid();
#endif
- out << "] Received event,"
- << " type: " << events[i].header.type
- << " source: " << events[i].header.source;
- if (events[i].data.any_value >>= eventData) {
- out << " text: " << eventData;
- }
+ out << "] Received event,"
+ << " type: " << events[i].header.type
+ << " source: " << events[i].header.source;
- ACE_OS::printf("%s\n", out.str().c_str()); // printf is synchronized
- }
- if (--event_limit_ <= 0) {
- orb_->shutdown(0);
- }
+#if !defined (TAO_LACKS_EVENT_CHANNEL_ANY)
+ if (events[i].data.any_value >>= eventData)
+ {
+ out << " text: " << eventData;
+ }
+#else
+ if (events[i].data.payload.length() > 0)
+ {
+ out << " text: " <<
+ (const char *)events[i].data.payload.get_buffer();
+ }
+#endif /* !TAO_LACKS_EVENT_CHANNEL_ANY */
+ ACE_OS::printf("%s\n", out.str().c_str()); // printf is synchronized
+ }
+ if (--event_limit_ <= 0)
+ {
+ orb_->shutdown(0);
+ }
}
// Implement the disconnect_push_consumer() operation.
diff --git a/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventSupplierMain.cpp b/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventSupplierMain.cpp
index 20515c9fc21..60c189c6f40 100644
--- a/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventSupplierMain.cpp
+++ b/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventSupplierMain.cpp
@@ -110,7 +110,8 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
CosNaming::NamingContextExt::_narrow(tmpobj.in());
// Bind the Event Channel using Naming Services
- CosNaming::Name_var name = root_context->to_name (ACE_TEXT_ALWAYS_CHAR (ecname));
+ CosNaming::Name_var name =
+ root_context->to_name (ACE_TEXT_ALWAYS_CHAR (ecname));
root_context->rebind(name.in(), ec.in());
// Get a proxy push consumer from the EventChannel.
@@ -213,7 +214,6 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
}
// Create an event (just a string in this case).
- const CORBA::String_var eventData = CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR (ecname));
// Create an event set for one event
RtecEventComm::EventSet event (1);
@@ -224,8 +224,19 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
event[0].header.ttl = 1;
event[0].header.type = MY_EVENT_TYPE;
+#if !defined (TAO_LACKS_EVENT_CHANNEL_ANY)
// Initialize data fields in event.
+ const CORBA::String_var eventData =
+ CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR (ecname));
+
event[0].data.any_value <<= eventData;
+#else
+ // Use the octet sequence payload instead
+ char *tmpstr = const_cast<char *>(ACE_TEXT_ALWAYS_CHAR (ecname));
+ size_t len = ACE_OS::strlen(tmpstr) +1;
+ event[0].data.payload.replace (len,len,
+ reinterpret_cast<CORBA::Octet *>(tmpstr));
+#endif /* !TAO_LACKS_EVENT_CHANNEL_ANY */
if (iorfile != 0) {
CORBA::String_var str = orb->object_to_string( ec.in() );
diff --git a/TAO/tao/Acceptor_Registry.cpp b/TAO/tao/Acceptor_Registry.cpp
index 37f5eb435ee..56087204e5a 100644
--- a/TAO/tao/Acceptor_Registry.cpp
+++ b/TAO/tao/Acceptor_Registry.cpp
@@ -383,7 +383,8 @@ int TAO_Acceptor_Registry::open_default (TAO_ORB_Core *orb_core,
LM_ERROR,
ACE_TEXT ("TAO (%P|%t) unable to create ")
ACE_TEXT ("an acceptor for <%s>\n"),
- ACE_TEXT_CHAR_TO_TCHAR ((*i)->protocol_name ().c_str ())
+ ACE_TEXT_CHAR_TO_TCHAR ((*i)->
+ protocol_name ().c_str ())
));
}
@@ -393,9 +394,10 @@ int TAO_Acceptor_Registry::open_default (TAO_ORB_Core *orb_core,
if ((*i)->factory ()->tag () == IOP::TAG_INTERNET_IOP)
{
// Open first acceptor on IPv4 ANY
- ACE_INET_Addr addr(static_cast<unsigned short> (0)); // IPv4 ANY
+ ACE_INET_Addr addr(static_cast<unsigned short> (0));
- TAO_IIOP_Acceptor* iiop_acceptor = dynamic_cast<TAO_IIOP_Acceptor*> (acceptor);
+ TAO_IIOP_Acceptor* iiop_acceptor =
+ dynamic_cast<TAO_IIOP_Acceptor*> (acceptor);
if (!iiop_acceptor)
return -1;
@@ -404,8 +406,8 @@ int TAO_Acceptor_Registry::open_default (TAO_ORB_Core *orb_core,
if (this->open_default_i (orb_core,
reactor,
- TAO_DEF_GIOP_MAJOR, // default major
- TAO_DEF_GIOP_MINOR, // default minor
+ TAO_DEF_GIOP_MAJOR,
+ TAO_DEF_GIOP_MINOR,
i,
acceptor,
options) != 0)
@@ -414,7 +416,8 @@ int TAO_Acceptor_Registry::open_default (TAO_ORB_Core *orb_core,
}
// record the port chosen for the IPv4 acceptor
- u_short port = iiop_acceptor->default_address ().get_port_number ();
+ u_short port =
+ iiop_acceptor->default_address ().get_port_number ();
// Create second acceptor for IPV6 traffic
acceptor =
@@ -428,39 +431,44 @@ int TAO_Acceptor_Registry::open_default (TAO_ORB_Core *orb_core,
LM_ERROR,
ACE_TEXT ("TAO (%P|%t) unable to create ")
ACE_TEXT ("an acceptor for <%s>\n"),
- ACE_TEXT_CHAR_TO_TCHAR ((*i)->protocol_name ().c_str ())
+ ACE_TEXT_CHAR_TO_TCHAR ((*i)->
+ protocol_name ().c_str ())
));
}
return -1;
}
- addr.set (port, ACE_IPV6_ANY, AF_INET6); // IPv6 ANY on specified port
-
- iiop_acceptor = dynamic_cast<TAO_IIOP_Acceptor*> (acceptor);
-
- if (!iiop_acceptor)
- return -1;
-
- iiop_acceptor->set_default_address (addr);
-
- if (this->open_default_i (orb_core,
- reactor,
- TAO_DEF_GIOP_MAJOR, // default major
- TAO_DEF_GIOP_MINOR, // default minor
- i,
- acceptor,
- options) != 0)
- {
- return -1;
- }
+ if (ACE::ipv6_enabled() &&
+ addr.set (port, ACE_IPV6_ANY, 1, AF_INET6) == 0)
+ {
+
+ iiop_acceptor =
+ dynamic_cast<TAO_IIOP_Acceptor*> (acceptor);
+
+ if (!iiop_acceptor)
+ return -1;
+
+ iiop_acceptor->set_default_address (addr);
+
+ if (this->open_default_i (orb_core,
+ reactor,
+ TAO_DEF_GIOP_MAJOR,
+ TAO_DEF_GIOP_MINOR,
+ i,
+ acceptor,
+ options) != 0)
+ {
+ return -1;
+ }
+ }
}
else
{
if (this->open_default_i (orb_core,
reactor,
- TAO_DEF_GIOP_MAJOR, // default major
- TAO_DEF_GIOP_MINOR, // default minor
+ TAO_DEF_GIOP_MAJOR,
+ TAO_DEF_GIOP_MINOR,
i,
acceptor,
options) != 0)
diff --git a/TAO/tao/IIOP_Acceptor.cpp b/TAO/tao/IIOP_Acceptor.cpp
index b3f4ace21ad..ff1a053824a 100644
--- a/TAO/tao/IIOP_Acceptor.cpp
+++ b/TAO/tao/IIOP_Acceptor.cpp
@@ -39,16 +39,21 @@ TAO_IIOP_Acceptor::TAO_IIOP_Acceptor (void)
version_ (TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR),
orb_core_ (0),
reuse_addr_ (1),
-#if defined (ACE_HAS_IPV6)
+#if defined (ACE_HAS_IPV6) && !defined (ACE_USES_IPV4_IPV6_MIGRATION)
default_address_ (static_cast<unsigned short> (0), ACE_IPV6_ANY, AF_INET6),
#else
default_address_ (static_cast<unsigned short> (0), static_cast<ACE_UINT32> (INADDR_ANY)),
-#endif /* ACE_HAS_IPV6 */
+#endif /* ACE_HAS_IPV6 && !ACE_USES_IPV4_IPV6_MIGRATION */
base_acceptor_ (this),
creation_strategy_ (0),
concurrency_strategy_ (0),
accept_strategy_ (0)
{
+#if defined (ACE_HAS_IPV6) && defined (ACE_USES_IPV4_IPV6_MIGRATION)
+ if (ACE::ipv6_enabled())
+ default_address_.set (static_cast<unsigned short> (0),
+ ACE_IPV6_ANY, AF_INET6);
+#endif /* ACE_HAS_IPV6 && ACE_USES_IPV4_IPV6_MIGRATION */
}
//@@ TAO_ACCEPTOR_SPL_COPY_HOOK_END