diff options
author | marina <marina@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-12-04 22:15:29 +0000 |
---|---|---|
committer | marina <marina@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-12-04 22:15:29 +0000 |
commit | 99b6f4449b89e33a1a86b641d41b161bbbdfe003 (patch) | |
tree | 15488d9e15a2a5a528a66d030c22e22ee9f59ba1 /TAO | |
parent | 39b906774d30ccff4a7fc1badff3a898a3b7b0f2 (diff) | |
download | ATCD-99b6f4449b89e33a1a86b641d41b161bbbdfe003.tar.gz |
ChangeLogTag:Mon Dec 4 15:58:47 2000 Marina Spivak <marina@cs.wustl.edu>
Diffstat (limited to 'TAO')
-rw-r--r-- | TAO/ChangeLogs/ChangeLog-02a | 17 | ||||
-rw-r--r-- | TAO/tao/IIOP_Endpoint.cpp | 6 | ||||
-rw-r--r-- | TAO/tao/IIOP_Profile.cpp | 17 | ||||
-rw-r--r-- | TAO/tao/IIOP_Profile.h | 4 | ||||
-rw-r--r-- | TAO/tao/Strategies/SHMIOP_Profile.cpp | 19 | ||||
-rw-r--r-- | TAO/tao/Strategies/SHMIOP_Profile.h | 2 | ||||
-rw-r--r-- | TAO/tao/Strategies/UIOP_Profile.cpp | 19 | ||||
-rw-r--r-- | TAO/tao/Strategies/UIOP_Profile.h | 2 |
8 files changed, 65 insertions, 21 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a index 48945d52bbd..0c98a720a3e 100644 --- a/TAO/ChangeLogs/ChangeLog-02a +++ b/TAO/ChangeLogs/ChangeLog-02a @@ -1,3 +1,20 @@ +Mon Dec 4 15:58:47 2000 Marina Spivak <marina@cs.wustl.edu> + + * tao/IIOP_Profile.h + * tao/IIOP_Profile.cpp + * tao/Strategies/UIOP_Profile.h + * tao/Strategies/UIOP_Profile.cpp + * tao/Strategies/SHMIOP_Profile.h + * tao/Strategies/SHMIOP_Profile.cpp: + + Added error checks in <decode> and <decode_endpoints> methods. + For efficiency, <decode_endpoints> is now called onlywith + RTCORBA. + + * tao/IIOP_Endpoint.cpp (duplicate): + + Added comment. + Mon Dec 4 13:04:55 2000 Marina Spivak <marina@cs.wustl.edu> * tao/Invocation.h diff --git a/TAO/tao/IIOP_Endpoint.cpp b/TAO/tao/IIOP_Endpoint.cpp index 05961e61f7b..4cdd0117f69 100644 --- a/TAO/tao/IIOP_Endpoint.cpp +++ b/TAO/tao/IIOP_Endpoint.cpp @@ -143,6 +143,12 @@ TAO_IIOP_Endpoint::next (void) TAO_Endpoint * TAO_IIOP_Endpoint::duplicate (void) { + // @@ Bala, we probably need to make sure that the duplicate has the + // same priority as the original. Although it does not matter in + // the context this method is currently used, if somebody ends up + // using this method for some other purpose later, this will be a + // seed for bugs. + TAO_IIOP_Endpoint *endpoint = 0; ACE_NEW_RETURN (endpoint, diff --git a/TAO/tao/IIOP_Profile.cpp b/TAO/tao/IIOP_Profile.cpp index 48190c02b80..4844da01333 100644 --- a/TAO/tao/IIOP_Profile.cpp +++ b/TAO/tao/IIOP_Profile.cpp @@ -165,8 +165,15 @@ TAO_IIOP_Profile::decode (TAO_InputCDR& cdr) encap_len)); } +#if (TAO_HAS_RT_CORBA == 1) + // This protection is here not for correctness but for efficiency. + // Currently there are > 1 endpoint per profile only with RTCORBA. + // Decode endpoints, if any. - this->decode_endpoints (); + if (this->decode_endpoints () == -1) + return -1; + +#endif /* TAO_HAS_RT_CORBA == 1 */ if (cdr.good_bit ()) { @@ -639,14 +646,14 @@ TAO_IIOP_Profile::decode_endpoints (void) // Extract the Byte Order. CORBA::Boolean byte_order; if ((in_cdr >> ACE_InputCDR::to_boolean (byte_order)) == 0) - return 0; + return -1; in_cdr.reset_byte_order (ACE_static_cast(int, byte_order)); // Extract endpoints sequence. TAO_IIOPEndpointSequence endpoints; if ((in_cdr >> endpoints) == 0) - return 0; + return -1; // Get the priority of the first endpoint (head of the list. // It's other data is extracted as part of the standard profile @@ -668,11 +675,11 @@ TAO_IIOP_Profile::decode_endpoints (void) TAO_IIOP_Endpoint (endpoints[i].host, endpoints[i].port, endpoints[i].priority), - 0); + -1); this->add_endpoint (endpoint); } } - return 1; + return 0; } diff --git a/TAO/tao/IIOP_Profile.h b/TAO/tao/IIOP_Profile.h index e26a5b2fb26..b0182a47fc3 100644 --- a/TAO/tao/IIOP_Profile.h +++ b/TAO/tao/IIOP_Profile.h @@ -124,7 +124,7 @@ public: // allocated for the returned key. virtual TAO_Endpoint *endpoint (void); - // Return pointer to the head of this profile's endpoints list. + // Return pointer to the head of this profile's endpoints list. virtual size_t endpoint_count (void); // Return how many endpoints this profile contains. @@ -158,7 +158,7 @@ private: // Decode only if RTCORBA is enabled. Furthermore, we may not find // TAO_TAG_ENDPOINTS component, e.g., if we are talking to nonRT // version of TAO or some other ORB. This is not an error, and we - // must proceed. + // must proceed. Return 0 on success and -1 on failure. protected: diff --git a/TAO/tao/Strategies/SHMIOP_Profile.cpp b/TAO/tao/Strategies/SHMIOP_Profile.cpp index 8d027b10afd..343bd34d816 100644 --- a/TAO/tao/Strategies/SHMIOP_Profile.cpp +++ b/TAO/tao/Strategies/SHMIOP_Profile.cpp @@ -171,8 +171,15 @@ TAO_SHMIOP_Profile::decode (TAO_InputCDR& cdr) encap_len)); } - // Decode endpoints if any. - this->decode_endpoints (); +#if (TAO_HAS_RT_CORBA == 1) + // This protection is here not for correctness but for efficiency. + // Currently there are > 1 endpoint per profile only with RTCORBA. + + // Decode endpoints, if any. + if (this->decode_endpoints () == -1) + return -1; + +#endif /* TAO_HAS_RT_CORBA == 1 */ if (cdr.good_bit ()) { @@ -601,14 +608,14 @@ TAO_SHMIOP_Profile::decode_endpoints (void) // Extract the Byte Order. CORBA::Boolean byte_order; if ((in_cdr >> ACE_InputCDR::to_boolean (byte_order)) == 0) - return 0; + return -1; in_cdr.reset_byte_order (ACE_static_cast(int, byte_order)); // Extract endpoints sequence. TAO_IIOPEndpointSequence endpoints; if ((in_cdr >> endpoints) == 0) - return 0; + return -1; // Get the priority of the first endpoint (head of the list. // It's other data is extracted as part of the standard profile @@ -630,13 +637,13 @@ TAO_SHMIOP_Profile::decode_endpoints (void) TAO_SHMIOP_Endpoint (endpoints[i].host, endpoints[i].port, endpoints[i].priority), - 0); + -1); this->add_endpoint (endpoint); } } - return 1; + return 0; } diff --git a/TAO/tao/Strategies/SHMIOP_Profile.h b/TAO/tao/Strategies/SHMIOP_Profile.h index f490ae232bc..517f1e50794 100644 --- a/TAO/tao/Strategies/SHMIOP_Profile.h +++ b/TAO/tao/Strategies/SHMIOP_Profile.h @@ -156,7 +156,7 @@ private: // Decode only if RTCORBA is enabled. Furthermore, we may not find // TAO_TAG_ENDPOINTS component, e.g., if we are talking to nonRT // version of TAO or some other ORB. This is not an error, and we - // must proceed. + // must proceed. Return 0 on success and -1 on failure. TAO_SHMIOP_Endpoint endpoint_; // Head of this profile's list of endpoints. This endpoint is not diff --git a/TAO/tao/Strategies/UIOP_Profile.cpp b/TAO/tao/Strategies/UIOP_Profile.cpp index eca22515c50..d66193497ed 100644 --- a/TAO/tao/Strategies/UIOP_Profile.cpp +++ b/TAO/tao/Strategies/UIOP_Profile.cpp @@ -378,8 +378,15 @@ TAO_UIOP_Profile::decode (TAO_InputCDR& cdr) encap_len)); } - // Decode endpoints if any. - this->decode_endpoints (); +#if (TAO_HAS_RT_CORBA == 1) + // This protection is here not for correctness but for efficiency. + // Currently there are > 1 endpoint per profile only with RTCORBA. + + // Decode endpoints, if any. + if (this->decode_endpoints () == -1) + return -1; + +#endif /* TAO_HAS_RT_CORBA == 1 */ if (cdr.good_bit ()) return 1; @@ -551,14 +558,14 @@ TAO_UIOP_Profile::decode_endpoints (void) // Extract the Byte Order. CORBA::Boolean byte_order; if ((in_cdr >> ACE_InputCDR::to_boolean (byte_order)) == 0) - return 0; + return -1; in_cdr.reset_byte_order (ACE_static_cast(int, byte_order)); // Extract endpoints sequence. TAO_UIOPEndpointSequence endpoints; if ((in_cdr >> endpoints) == 0) - return 0; + return -1; // Get the priority of the first endpoint (head of the list. // It's other data is extracted as part of the standard profile @@ -578,7 +585,7 @@ TAO_UIOP_Profile::decode_endpoints (void) TAO_UIOP_Endpoint *endpoint = 0; ACE_NEW_RETURN (endpoint, TAO_UIOP_Endpoint, - 0); + -1); this->add_endpoint (endpoint); if (endpoint->object_addr_.set (endpoints[i].rendezvous_point) @@ -601,7 +608,7 @@ TAO_UIOP_Profile::decode_endpoints (void) } } - return 1; + return 0; } #endif /* TAO_HAS_UIOP == 1 */ diff --git a/TAO/tao/Strategies/UIOP_Profile.h b/TAO/tao/Strategies/UIOP_Profile.h index 407eb33dab8..1746c4b0425 100644 --- a/TAO/tao/Strategies/UIOP_Profile.h +++ b/TAO/tao/Strategies/UIOP_Profile.h @@ -157,7 +157,7 @@ private: // Decode only if RTCORBA is enabled. Furthermore, we may not find // TAO_TAG_ENDPOINTS component, e.g., if we are talking to nonRT // version of TAO or some other ORB. This is not an error, and we - // must proceed. + // must proceed. Return 0 on success and -1 on failure. TAO_UIOP_Endpoint endpoint_; // Head of this profile's list of endpoints. This endpoint is not |