diff options
author | bala <balanatarajan@users.noreply.github.com> | 2004-11-29 17:54:03 +0000 |
---|---|---|
committer | bala <balanatarajan@users.noreply.github.com> | 2004-11-29 17:54:03 +0000 |
commit | b106d27f113292a8fd9046f8c80c2fc081a65871 (patch) | |
tree | a351e2db1256005e97eca9823481e1b044858d51 | |
parent | 4d2d004270305c0e6715cbd5cce64024d7528680 (diff) | |
download | ATCD-b106d27f113292a8fd9046f8c80c2fc081a65871.tar.gz |
ChangeLogTag:Mon Nov 29 17:45:55 2004 Balachandran Natarajan <bala@dre.vanderbilt.edu>
-rw-r--r-- | TAO/ChangeLog | 20 | ||||
-rw-r--r-- | TAO/tao/IIOP_Endpoint.cpp | 9 | ||||
-rw-r--r-- | TAO/tao/IIOP_Endpoint.h | 3 | ||||
-rw-r--r-- | TAO/tao/IIOP_Profile.cpp | 32 | ||||
-rw-r--r-- | TAO/tao/Strategies/SCIOP_Endpoint.cpp | 9 | ||||
-rw-r--r-- | TAO/tao/Strategies/SCIOP_Endpoint.h | 3 | ||||
-rw-r--r-- | TAO/tao/Strategies/SCIOP_Profile.cpp | 29 |
7 files changed, 91 insertions, 14 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 9dd245ddb27..828afccaf78 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,23 @@ +Mon Nov 29 17:45:55 2004 Balachandran Natarajan <bala@dre.vanderbilt.edu> + + * tao/IIOP_Endpoint.cpp: + * tao/IIOP_Endpoint.h: + + Added a bool which holds the details of when the endpoint is + encodable. For example, endpoints created by RTCORBA for + multiple priorities need to be encoded whereas endpoints created + for preffered netwroks need not be encoded. + + * tao/IIOP_Profile.cpp: + + Check the status of the bool before encoding th eendpoint. + + * tao/Strategies/SCIOP_Endpoint.cpp: + * tao/Strategies/SCIOP_Endpoint.h: + * tao/Strategies/SCIOP_Profile.cpp: + + Repeat the above changes for SCIOP. + Mon Nov 29 07:19:16 2004 Ciju John <john_c@ociweb.com> * orbsvcs/tests/Notify/Discarding/run_test.pl: diff --git a/TAO/tao/IIOP_Endpoint.cpp b/TAO/tao/IIOP_Endpoint.cpp index e8efe14d63f..707fbd39689 100644 --- a/TAO/tao/IIOP_Endpoint.cpp +++ b/TAO/tao/IIOP_Endpoint.cpp @@ -27,6 +27,7 @@ TAO_IIOP_Endpoint::TAO_IIOP_Endpoint (const ACE_INET_Addr &addr, , object_addr_ (addr) , object_addr_set_ (false) , preferred_path_ () + , is_encodable_ (true) , next_ (0) { this->set (addr, use_dotted_decimal_addresses); @@ -43,6 +44,7 @@ TAO_IIOP_Endpoint::TAO_IIOP_Endpoint (const char *host, , object_addr_ (addr) , object_addr_set_ (false) , preferred_path_ () + , is_encodable_ (true) , next_ (0) { } @@ -54,6 +56,7 @@ TAO_IIOP_Endpoint::TAO_IIOP_Endpoint (void) , object_addr_ () , object_addr_set_ (false) , preferred_path_ () + , is_encodable_ (true) , next_ (0) { } @@ -67,6 +70,7 @@ TAO_IIOP_Endpoint::TAO_IIOP_Endpoint (const char *host, , object_addr_ () , object_addr_set_ (false) , preferred_path_ () + , is_encodable_ (true) , next_ (0) { if (host != 0) @@ -87,6 +91,7 @@ TAO_IIOP_Endpoint::TAO_IIOP_Endpoint (const TAO_IIOP_Endpoint &rhs) , object_addr_ (rhs.object_addr_) , object_addr_set_ (rhs.object_addr_set_) , preferred_path_ (rhs.preferred_path_) + , is_encodable_ (rhs.is_encodable_) , next_ (0) { } @@ -290,6 +295,8 @@ TAO_IIOP_Endpoint::preferred_interfaces (TAO_ORB_Core *oc) if (latest->next_ == 0) return count; + latest->is_encodable_ = true; + latest = latest->next_; ++count; } @@ -305,6 +312,8 @@ TAO_IIOP_Endpoint::preferred_interfaces (TAO_ORB_Core *oc) if (latest->next_ == 0) return count; + latest->is_encodable_ = true; + latest->next_->preferred_path_.host = (const char *) 0; ++count; } diff --git a/TAO/tao/IIOP_Endpoint.h b/TAO/tao/IIOP_Endpoint.h index be22c89ef4a..a784d9e737a 100644 --- a/TAO/tao/IIOP_Endpoint.h +++ b/TAO/tao/IIOP_Endpoint.h @@ -150,6 +150,9 @@ private: /// Preferred path for this endpoint. TAO::IIOP_Endpoint_Info preferred_path_; + /// Is this endpoint created encodable as part of the IOR? + bool is_encodable_; + /// IIOP Endpoints can be stringed into a list. Return the next /// endpoint in the list, if any. TAO_IIOP_Endpoint *next_; diff --git a/TAO/tao/IIOP_Profile.cpp b/TAO/tao/IIOP_Profile.cpp index 1d07a977833..3c7bc00e96f 100644 --- a/TAO/tao/IIOP_Profile.cpp +++ b/TAO/tao/IIOP_Profile.cpp @@ -393,6 +393,21 @@ TAO_IIOP_Profile::create_profile_body (TAO_OutputCDR &encap) const int TAO_IIOP_Profile::encode_endpoints (void) { + CORBA::ULong actual_count = 0; + + const TAO_IIOP_Endpoint *endpoint = &this->endpoint_; + + // Count the number of endpoints that needs to be encoded + for (CORBA::ULong c = 0; + c != this->count_; + ++c) + { + if (endpoint->is_encodable_) + ++actual_count; + + endpoint = endpoint->next_; + } + // Create a data structure and fill it with endpoint info for wire // transfer. // We include information for the head of the list @@ -401,17 +416,20 @@ TAO_IIOP_Profile::encode_endpoints (void) // priority is not! TAO::IIOPEndpointSequence endpoints; - endpoints.length (this->count_); + endpoints.length (actual_count); + + endpoint = &this->endpoint_; - const TAO_IIOP_Endpoint *endpoint = &this->endpoint_; for (CORBA::ULong i = 0; - i < this->count_; + i < actual_count; ++i) { - endpoints[i].host = endpoint->host (); - endpoints[i].port = endpoint->port (); - endpoints[i].priority = endpoint->priority (); - + if (endpoint->is_encodable_) + { + endpoints[i].host = endpoint->host (); + endpoints[i].port = endpoint->port (); + endpoints[i].priority = endpoint->priority (); + } endpoint = endpoint->next_; } diff --git a/TAO/tao/Strategies/SCIOP_Endpoint.cpp b/TAO/tao/Strategies/SCIOP_Endpoint.cpp index 3af168fbcd5..c637c950971 100644 --- a/TAO/tao/Strategies/SCIOP_Endpoint.cpp +++ b/TAO/tao/Strategies/SCIOP_Endpoint.cpp @@ -31,6 +31,7 @@ TAO_SCIOP_Endpoint::TAO_SCIOP_Endpoint (const ACE_INET_Addr &addr, , object_addr_ (addr) , object_addr_set_ (0) , preferred_path_ () + , is_encodable_ (true) , next_ (0) { this->set (addr, use_dotted_decimal_addresses); @@ -47,6 +48,7 @@ TAO_SCIOP_Endpoint::TAO_SCIOP_Endpoint (const char *host, , object_addr_ (addr) , object_addr_set_ (0) , preferred_path_ () + , is_encodable_ (true) , next_ (0) { } @@ -58,6 +60,7 @@ TAO_SCIOP_Endpoint::TAO_SCIOP_Endpoint (void) , object_addr_ () , object_addr_set_ (0) , preferred_path_ () + , is_encodable_ (true) , next_ (0) { } @@ -71,6 +74,7 @@ TAO_SCIOP_Endpoint::TAO_SCIOP_Endpoint (const char *host, , object_addr_ () , object_addr_set_ (0) , preferred_path_ () + , is_encodable_ (true) , next_ (0) { this->priority (priority); @@ -88,6 +92,7 @@ TAO_SCIOP_Endpoint::TAO_IIOP_Endpoint (const TAO_SCIOP_Endpoint &rhs) , object_addr_ (rhs.object_addr_) , object_addr_set_ (rhs.object_addr_set_) , preferred_path_ (rhs.preferred_path_) + , is_encodable_ (rhs.is_encodable_) , next_ (0) { } @@ -316,7 +321,7 @@ TAO_SCIOP_Endpoint::preferred_interfaces (TAO_ORB_Core *oc) TAO_Endpoint *tmp_ep = latest->duplicate (); - latest->next_ = dynamic_cast<TAO_IIOP_Endpoint *> (tmp_ep); + latest->next_ = dynamic_cast<TAO_SCIOP_Endpoint *> (tmp_ep); if (latest->next_ == 0) return count; @@ -331,7 +336,7 @@ TAO_SCIOP_Endpoint::preferred_interfaces (TAO_ORB_Core *oc) TAO_Endpoint *tmp_ep = latest->duplicate (); latest->next_ = - dynamic_cast<TAO_IIOP_Endpoint *> (tmp_ep); + dynamic_cast<TAO_SCIOP_Endpoint *> (tmp_ep); if (latest->next_ == 0) return count; diff --git a/TAO/tao/Strategies/SCIOP_Endpoint.h b/TAO/tao/Strategies/SCIOP_Endpoint.h index 7c7791bf007..d131b3ca61f 100644 --- a/TAO/tao/Strategies/SCIOP_Endpoint.h +++ b/TAO/tao/Strategies/SCIOP_Endpoint.h @@ -151,6 +151,9 @@ private: /// Preferred path for this endpoint. TAO::IIOP_Endpoint_Info preferred_path_; + /// Is this endpoint created encodable as part of the IOR? + bool is_encodable_; + /// SCIOP Endpoints can be stringed into a list. Return the next /// endpoint in the list, if any. TAO_SCIOP_Endpoint *next_; diff --git a/TAO/tao/Strategies/SCIOP_Profile.cpp b/TAO/tao/Strategies/SCIOP_Profile.cpp index 52330ee07bc..e196c9cbf1f 100644 --- a/TAO/tao/Strategies/SCIOP_Profile.cpp +++ b/TAO/tao/Strategies/SCIOP_Profile.cpp @@ -408,6 +408,21 @@ TAO_SCIOP_Profile::create_profile_body (TAO_OutputCDR &encap) const int TAO_SCIOP_Profile::encode_endpoints (void) { + CORBA::ULong actual_count = 0; + + const TAO_SCIOP_Endpoint *endpoint = &this->endpoint_; + + // Count the number of endpoints that needs to be encoded + for (CORBA::ULong c = 0; + c != this->count_; + ++c) + { + if (endpoint->is_encodable_) + ++actual_count; + + endpoint = endpoint->next_; + } + // Create a data structure and fill it with endpoint info for wire // transfer. // We include information for the head of the list @@ -416,16 +431,20 @@ TAO_SCIOP_Profile::encode_endpoints (void) // priority is not! TAO_SCIOPEndpointSequence endpoints; - endpoints.length (this->count_); + endpoints.length (actual_count); + + endpoint = &this->endpoint_; - const TAO_SCIOP_Endpoint *endpoint = &this->endpoint_; for (CORBA::ULong i = 0; i < this->count_; ++i) { - endpoints[i].host = endpoint->host (); - endpoints[i].port = endpoint->port (); - endpoints[i].priority = endpoint->priority (); + if (endpoint->is_encodable_) + { + endpoints[i].host = endpoint->host (); + endpoints[i].port = endpoint->port (); + endpoints[i].priority = endpoint->priority (); + } endpoint = endpoint->next_; } |