summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Mesnier <mesnier_p@ociweb.com>2007-08-08 15:51:45 +0000
committerPhil Mesnier <mesnier_p@ociweb.com>2007-08-08 15:51:45 +0000
commit1ee4169fd3ea9591506bf96f08435fe1f8fbefea (patch)
tree2b7d43a05ad2872ee26af85ff5af997afbfb9674
parentf2928d963a84f2d2e99801e72101b0adb9da5379 (diff)
downloadATCD-1ee4169fd3ea9591506bf96f08435fe1f8fbefea.tar.gz
Wed Aug 8 15:06:35 UTC 2007 Phil Mesnier <mesnier_p@ociweb.com>
-rw-r--r--TAO/ChangeLog15
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.cpp18
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.cpp14
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp19
-rw-r--r--TAO/tao/TAO_Server_Request.cpp28
5 files changed, 65 insertions, 29 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index ba19e8719af..f3b23b76d45 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,18 @@
+Wed Aug 8 15:06:35 UTC 2007 Phil Mesnier <mesnier_p@ociweb.com>
+
+ * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.cpp:
+ * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.cpp:
+ * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp:
+
+ Fix for SSLIOP when used with IPv6 and Bidir.
+
+ * tao/TAO_Server_Request.cpp:
+
+ Fix for using GIOP versions other than the default. The
+ particular problem was that servers always return raised
+ exceptions using their default GIOP version, not the version
+ used by the client.
+
Wed Aug 8 14:56:12 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl>
* tao/ORB.{h,cpp,inl}:
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.cpp
index 3d06df6cbf0..7f05ba7f4c7 100644
--- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.cpp
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.cpp
@@ -169,11 +169,7 @@ TAO::SSLIOP::Connection_Handler::open (void *)
if (this->peer ().get_local_addr (local_addr) == -1)
return -1;
- int use_dotted_decimal_addresses =
- this->orb_core ()->orb_params ()->use_dotted_decimal_addresses ();
-
- if (local_addr.get_ip_address () == remote_addr.get_ip_address ()
- && local_addr.get_port_number () == remote_addr.get_port_number ())
+ if (local_addr == remote_addr)
{
if (TAO_debug_level > 0)
{
@@ -181,11 +177,9 @@ TAO::SSLIOP::Connection_Handler::open (void *)
char local_as_string[MAXHOSTNAMELEN + 16];
(void) remote_addr.addr_to_string (remote_as_string,
- sizeof (remote_as_string),
- use_dotted_decimal_addresses);
+ sizeof (remote_as_string));
(void) local_addr.addr_to_string (local_as_string,
- sizeof (local_as_string),
- use_dotted_decimal_addresses);
+ sizeof (local_as_string));
ACE_ERROR ((LM_ERROR,
"TAO(%P|%t) - TAO::SSLIOP::Connection_Handler::open, "
"Holy Cow! The remote addr and "
@@ -202,8 +196,7 @@ TAO::SSLIOP::Connection_Handler::open (void *)
// Verify that we can resolve the peer hostname.
if (remote_addr.addr_to_string (client,
- sizeof (client),
- use_dotted_decimal_addresses) == -1)
+ sizeof (client)) == -1)
{
ACE_OS::strcpy (client, "*unable to obtain*");
}
@@ -216,8 +209,7 @@ TAO::SSLIOP::Connection_Handler::open (void *)
// Verify that we can resolve our hostname.
if (local_addr.addr_to_string (client,
- sizeof (client),
- use_dotted_decimal_addresses) == -1)
+ sizeof (client)) == -1)
{
ACE_OS::strcpy (client, "*unable to obtain*");
}
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.cpp
index c508a538ab1..eb0685a867c 100644
--- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.cpp
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.cpp
@@ -261,7 +261,7 @@ TAO_SSLIOP_Endpoint::hash (void)
// bi-directional support - as the 'guessed' IIOP port value will
// hardly match the one specified in the bi-dir service context.
this->hash_val_ =
- oaddr.get_ip_address ()
+ oaddr.hash ()
+ this->ssl_component_.port;
}
@@ -279,7 +279,11 @@ TAO_SSLIOP_Endpoint::object_addr (void) const
// ...etc..
// Double checked locking optimization.
- if (this->object_addr_.get_type () != AF_INET)
+ if (this->object_addr_.get_type () != AF_INET
+#if defined (ACE_HAS_IPV6)
+ && this->object_addr_.get_type () != AF_INET6
+#endif /* ACE_HAS_IPV6 */
+ )
{
const ACE_INET_Addr &iiop_addr = this->iiop_endpoint_->object_addr ();
@@ -288,7 +292,11 @@ TAO_SSLIOP_Endpoint::object_addr (void) const
this->addr_lookup_lock_,
this->object_addr_);
- if (this->object_addr_.get_type () != AF_INET)
+ if (this->object_addr_.get_type () != AF_INET
+#if defined (ACE_HAS_IPV6)
+ && this->object_addr_.get_type () != AF_INET6
+#endif /* ACE_HAS_IPV6 */
+ )
{
this->object_addr_ = iiop_addr;
this->object_addr_.set_port_number (this->ssl_component_.port);
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp
index 53d72f81243..1b590a1a211 100644
--- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp
@@ -351,10 +351,25 @@ TAO::SSLIOP::Transport::get_listen_point (
-1);
}
+#if defined (ACE_HAS_IPV6)
+ // If this is an IPv6 decimal linklocal address containing a scopeid than
+ // remove the scopeid from the information being sent.
+ const char *cp_scope = 0;
+ if (local_addr.get_type () == PF_INET6 &&
+ (cp_scope = ACE_OS::strchr (local_interface.in (), '%')) != 0)
+ {
+ CORBA::ULong len = cp_scope - local_interface.in ();
+ local_interface[len] = '\0';
+ }
+#endif /* ACE_HAS_IPV6 */
+
for (size_t index = 0; index < count; ++index)
{
- if (local_addr.get_ip_address ()
- == endpoint_addr[index].get_ip_address ())
+ // Make sure port numbers are equal so the following comparison
+ // only concerns the IP(v4/v6) address.
+ local_addr.set_port_number (endpoint_addr[index].get_port_number ());
+
+ if (local_addr == endpoint_addr[index])
{
// Get the count of the number of elements
const CORBA::ULong len = listen_point_list.length ();
diff --git a/TAO/tao/TAO_Server_Request.cpp b/TAO/tao/TAO_Server_Request.cpp
index 00b0e5913a4..ccb98559971 100644
--- a/TAO/tao/TAO_Server_Request.cpp
+++ b/TAO/tao/TAO_Server_Request.cpp
@@ -406,6 +406,10 @@ TAO_ServerRequest::tao_send_reply_exception (const CORBA::Exception &ex)
#else
char repbuf[ACE_CDR::DEFAULT_BUFSIZE];
#endif /* ACE_INITIALIZE_MEMORY_BEFORE_USE */
+ TAO_GIOP_Message_Version gv;
+ if (this->outgoing_)
+ this->outgoing_->get_version (gv);
+
TAO_OutputCDR output (repbuf,
sizeof repbuf,
TAO_ENCAP_BYTE_ORDER,
@@ -414,8 +418,8 @@ TAO_ServerRequest::tao_send_reply_exception (const CORBA::Exception &ex)
this->orb_core_->output_cdr_msgblock_allocator (),
this->orb_core_->orb_params ()->cdr_memcpy_tradeoff (),
this->mesg_base_->fragmentation_strategy (),
- TAO_DEF_GIOP_MAJOR,
- TAO_DEF_GIOP_MINOR);
+ gv.major,
+ gv.minor);
this->transport_->assign_translators (0, &output);
// Make the reply message
@@ -461,15 +465,17 @@ void
TAO_ServerRequest::send_cached_reply (CORBA::OctetSeq &s)
{
#if defined(ACE_HAS_PURIFY)
- // Only inititialize the buffer if we're compiling with Purify.
- // Otherwise, there is no real need to do so, especially since
- // we can avoid the initialization overhead at runtime if we
- // are not compiling with Purify support.
- char repbuf[ACE_CDR::DEFAULT_BUFSIZE] = { 0 };
+ // Only inititialize the buffer if we're compiling with Purify.
+ // Otherwise, there is no real need to do so, especially since
+ // we can avoid the initialization overhead at runtime if we
+ // are not compiling with Purify support.
+ char repbuf[ACE_CDR::DEFAULT_BUFSIZE] = { 0 };
#else
- char repbuf[ACE_CDR::DEFAULT_BUFSIZE];
+ char repbuf[ACE_CDR::DEFAULT_BUFSIZE];
#endif /* ACE_HAS_PURIFY */
-
+ TAO_GIOP_Message_Version gv;
+ if (this->outgoing_)
+ this->outgoing_->get_version (gv);
TAO_OutputCDR output (repbuf,
sizeof repbuf,
TAO_ENCAP_BYTE_ORDER,
@@ -478,8 +484,8 @@ TAO_ServerRequest::send_cached_reply (CORBA::OctetSeq &s)
this->orb_core_->output_cdr_msgblock_allocator (),
this->orb_core_->orb_params ()->cdr_memcpy_tradeoff (),
this->mesg_base_->fragmentation_strategy (),
- TAO_DEF_GIOP_MAJOR,
- TAO_DEF_GIOP_MINOR);
+ gv.major,
+ gv.minor);
this->transport_->assign_translators (0, &output);