diff options
author | Adam Mitz <mitza-oci@users.noreply.github.com> | 2009-06-09 20:27:17 +0000 |
---|---|---|
committer | Adam Mitz <mitza-oci@users.noreply.github.com> | 2009-06-09 20:27:17 +0000 |
commit | 6e6848f7471a0f11e90181f2b939855ad26894c9 (patch) | |
tree | e102eb749d962b8b7ec66b6a7279584c2d73116e | |
parent | 990d9e397a0a111452408deaccbbd981e8346a93 (diff) | |
download | ATCD-6e6848f7471a0f11e90181f2b939855ad26894c9.tar.gz |
ChangeLogTag: Tue Jun 9 20:25:50 UTC 2009 Adam Mitz <mitza@ociweb.com>
-rw-r--r-- | TAO/ChangeLog | 14 | ||||
-rw-r--r-- | TAO/bin/tao_orb_tests.lst | 2 | ||||
-rw-r--r-- | TAO/tao/IIOP_Endpoint.cpp | 25 | ||||
-rw-r--r-- | TAO/tao/IIOP_Endpoint.h | 10 | ||||
-rw-r--r-- | TAO/tao/IIOP_Profile.cpp | 23 | ||||
-rw-r--r-- | TAO/tao/IIOP_Profile.h | 5 |
6 files changed, 57 insertions, 22 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 3d5d2a7d0b1..9c6017a0312 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,15 @@ +Tue Jun 9 20:25:50 UTC 2009 Adam Mitz <mitza@ociweb.com> + + * bin/tao_orb_tests.lst: + * tao/IIOP_Endpoint.h: + * tao/IIOP_Endpoint.cpp: + * tao/IIOP_Profile.h: + * tao/IIOP_Profile.cpp: + + Fix for bug #3695. Keep alternate endpoints within a profile in + the same order after marshalling/demarshalling so that is_equivalent + return true. + Tue Jun 9 15:37:40 UTC 2009 Phil Mesnier <mesnier_p@ociweb.com> * TAO_IDL/contrib/mcpp/directive.cpp: @@ -6,7 +18,7 @@ Tue Jun 9 15:37:40 UTC 2009 Phil Mesnier <mesnier_p@ociweb.com> * TAO_IDL/contrib/mcpp/internal.H: * TAO_IDL/contrib/mcpp/support.cpp: * TAO_IDL/contrib/mcpp/system.cpp: - + fuzz fix. Tue Jun 9 13:25:10 UTC 2009 Paul Calabrese <calabrese_p@ociweb.com> diff --git a/TAO/bin/tao_orb_tests.lst b/TAO/bin/tao_orb_tests.lst index 7ada201f2b0..18404c438c3 100644 --- a/TAO/bin/tao_orb_tests.lst +++ b/TAO/bin/tao_orb_tests.lst @@ -162,7 +162,7 @@ TAO/tests/Bug_3672_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MI TAO/tests/Bug_3674_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS TAO/tests/Bug_3676_Regression/run_test.pl: !NO_MESSAGING TAO/tests/Bug_3683_Regression/run_test.pl: -TAO/tests/Bug_3695_Regression/run_test.pl: !FIXED_BUGS_ONLY +TAO/tests/Bug_3695_Regression/run_test.pl: TAO/tests/DIOP/run_test.pl: !ST !NO_DIOP !ACE_FOR_TAO !CORBA_E_MICRO !LabVIEW_RT !WinCE !FUZZ TAO/tests/DIOP/run_test_ipv6.pl: IPV6 !ST !NO_DIOP !ACE_FOR_TAO !CORBA_E_MICRO !LabVIEW_RT !WinCE !FUZZ TAO/tests/RTCORBA/Activate_Object_Multiple_ORBs/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST diff --git a/TAO/tao/IIOP_Endpoint.cpp b/TAO/tao/IIOP_Endpoint.cpp index dca3bace0b9..5bb46b20d8d 100644 --- a/TAO/tao/IIOP_Endpoint.cpp +++ b/TAO/tao/IIOP_Endpoint.cpp @@ -11,6 +11,7 @@ #include "tao/IOPC.h" #include "tao/debug.h" #include "tao/ORB_Core.h" +#include "tao/IIOP_Profile.h" #include "ace/Log_Msg.h" #include "ace/Guard_T.h" @@ -411,14 +412,16 @@ static ACE_CString find_local(const ACE_Vector<ACE_CString>& local_ips, return ""; } -TAO_IIOP_Endpoint* -TAO_IIOP_Endpoint::add_local_endpoint(TAO_IIOP_Endpoint* ep, const char* local) +TAO_IIOP_Endpoint * +TAO_IIOP_Endpoint::add_local_endpoint (TAO_IIOP_Endpoint *ep, + const char *local, + TAO_IIOP_Profile &profile) { - TAO_Endpoint* tmp = ep->duplicate(); - ep->next_ = static_cast<TAO_IIOP_Endpoint*>(tmp); - ep->next_->is_encodable_ = true; - ep->next_->preferred_path_.host = CORBA::string_dup(local); - return ep->next_; + TAO_IIOP_Endpoint *tmp = static_cast<TAO_IIOP_Endpoint *> (ep->duplicate ()); + tmp->is_encodable_ = true; + tmp->preferred_path_.host = local; + profile.add_endpoint (tmp); + return tmp; } static void @@ -519,7 +522,9 @@ static void find_preferred_interfaces (const ACE_CString& host, } CORBA::ULong -TAO_IIOP_Endpoint::preferred_interfaces (const char* csv, bool enforce) +TAO_IIOP_Endpoint::preferred_interfaces (const char *csv, + bool enforce, + TAO_IIOP_Profile &profile) { ACE_Vector<ACE_CString> preferred; find_preferred_interfaces(this->host_.in(), csv, preferred); @@ -531,14 +536,14 @@ TAO_IIOP_Endpoint::preferred_interfaces (const char* csv, bool enforce) TAO_IIOP_Endpoint* ep = this; for (size_t i = 1; i < count; ++i) { - ep = add_local_endpoint(ep, preferred[i].c_str()); + ep = add_local_endpoint (ep, preferred[i].c_str(), profile); } // If we're not enforcing the preferred interfaces, then we can just add // a new non-preferred endpoint to the end with a default local addr. if (! enforce) { - ep = add_local_endpoint(ep, ""); + ep = add_local_endpoint (ep, "", profile); } else { diff --git a/TAO/tao/IIOP_Endpoint.h b/TAO/tao/IIOP_Endpoint.h index 147b5f80a25..b8abb2e1bb2 100644 --- a/TAO/tao/IIOP_Endpoint.h +++ b/TAO/tao/IIOP_Endpoint.h @@ -175,16 +175,20 @@ private: /// Generate preferred interfaces from the options passed in by the /// user. - CORBA::ULong preferred_interfaces (const char* csvPreferred, bool enforce); + CORBA::ULong preferred_interfaces (const char *csvPreferred, + bool enforce, + TAO_IIOP_Profile &profile); /// Chain a new duplicate of ourself with the specified /// local preferred interface. - TAO_IIOP_Endpoint* add_local_endpoint(TAO_IIOP_Endpoint* ep, const char* local); + TAO_IIOP_Endpoint *add_local_endpoint (TAO_IIOP_Endpoint *ep, + const char *local, + TAO_IIOP_Profile &profile); /// Canonical copy constructor /** * In private section to prevent clients from invoking this - * accidentally. Clients should only use duplicate () to make a depp + * accidentally. Clients should only use duplicate () to make a deep * copy */ TAO_IIOP_Endpoint (const TAO_IIOP_Endpoint &); diff --git a/TAO/tao/IIOP_Profile.cpp b/TAO/tao/IIOP_Profile.cpp index 1d096a191fb..e5bb5e7594d 100644 --- a/TAO/tao/IIOP_Profile.cpp +++ b/TAO/tao/IIOP_Profile.cpp @@ -58,6 +58,7 @@ TAO_IIOP_Profile::TAO_IIOP_Profile (const ACE_INET_Addr &addr, version), endpoint_ (addr, orb_core->orb_params ()->use_dotted_decimal_addresses ()), + last_endpoint_ (&this->endpoint_), count_ (1) { } @@ -73,6 +74,7 @@ TAO_IIOP_Profile::TAO_IIOP_Profile (const char* host, object_key, version), endpoint_ (host, port, addr), + last_endpoint_ (&this->endpoint_), count_ (1) { } @@ -83,6 +85,7 @@ TAO_IIOP_Profile::TAO_IIOP_Profile (TAO_ORB_Core *orb_core) TAO_GIOP_Message_Version (TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR)), endpoint_ (), + last_endpoint_ (&this->endpoint_), count_ (1) { } @@ -118,7 +121,7 @@ TAO_IIOP_Profile::decode_profile (TAO_InputCDR& cdr) const char* csv = this->orb_core()->orb_params()->preferred_interfaces(); bool const enforce = this->orb_core()->orb_params()->enforce_pref_interfaces(); - this->count_ += this->endpoint_.preferred_interfaces(csv, enforce); + this->count_ += this->endpoint_.preferred_interfaces(csv, enforce, *this); return 1; } @@ -394,8 +397,8 @@ TAO_IIOP_Profile::endpoint_count (void) const void TAO_IIOP_Profile::add_endpoint (TAO_IIOP_Endpoint *endp) { - endp->next_ = this->endpoint_.next_; - this->endpoint_.next_ = endp; + this->last_endpoint_->next_ = endp; + this->last_endpoint_ = endp; ++this->count_; } @@ -416,27 +419,35 @@ TAO_IIOP_Profile::remove_endpoint (TAO_IIOP_Endpoint *endp) // since the assignment operator does not copy the next_ // pointer, we must do it by hand this->endpoint_.next_ = n->next_; + if (this->last_endpoint_ == n) + { + this->last_endpoint_ = &this->endpoint_; + } delete n; } return; } - TAO_IIOP_Endpoint* last = &this->endpoint_; + TAO_IIOP_Endpoint* prev = &this->endpoint_; TAO_IIOP_Endpoint* cur = this->endpoint_.next_; while (cur != 0) { if (cur == endp) break; - last = cur; + prev = cur; cur = cur->next_; } if (cur != 0) { - last->next_ = cur->next_; + prev->next_ = cur->next_; cur->next_ = 0; --this->count_; + if (this->last_endpoint_ == cur) + { + this->last_endpoint_ = prev; + } delete cur; } } diff --git a/TAO/tao/IIOP_Profile.h b/TAO/tao/IIOP_Profile.h index e085c48ff75..ebb886e9958 100644 --- a/TAO/tao/IIOP_Profile.h +++ b/TAO/tao/IIOP_Profile.h @@ -72,7 +72,7 @@ public: /** * Add @a endp to this profile's list of endpoints (it is inserted - * next to the head of the list). This profiles takes ownership of + * at the end of the list). This profiles takes ownership of * @a endp. */ void add_endpoint (TAO_IIOP_Endpoint *endp); @@ -184,6 +184,9 @@ protected: TAO_IIOP_Endpoint endpoint_; + /// For efficient insertion at the end of the list + TAO_IIOP_Endpoint *last_endpoint_; + /// Number of endpoints in the list headed by <endpoint_>. CORBA::ULong count_; |