summaryrefslogtreecommitdiff
path: root/TAO
diff options
context:
space:
mode:
authorOssama Othman <ossama-othman@users.noreply.github.com>2001-12-14 00:41:11 +0000
committerOssama Othman <ossama-othman@users.noreply.github.com>2001-12-14 00:41:11 +0000
commite934a670bbd55d4139c312ffd8b9d7ce7faf0432 (patch)
tree188b57b82bba14652416149a26c95465c10957bb /TAO
parent22b380be9a10f3bfecb4d00c623d75b7d6d80123 (diff)
downloadATCD-e934a670bbd55d4139c312ffd8b9d7ce7faf0432.tar.gz
ChangeLogTag:Thu Dec 13 16:20:52 2001 Ossama Othman <ossama@uci.edu>
Diffstat (limited to 'TAO')
-rw-r--r--TAO/ChangeLogs/ChangeLog-02a32
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.cpp9
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.h12
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.i27
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Profile.cpp17
5 files changed, 86 insertions, 11 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a
index 49c0d0a83f1..6f8f3fdbff0 100644
--- a/TAO/ChangeLogs/ChangeLog-02a
+++ b/TAO/ChangeLogs/ChangeLog-02a
@@ -1,3 +1,35 @@
+Thu Dec 13 16:20:52 2001 Ossama Othman <ossama@uci.edu>
+
+ * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.h (iiop_endpoint):
+ * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.i (iiop_endpoint):
+
+ New method that sets the IIOP-specific endpoint counterpart.
+ The given TAO_IIOP_Endpoint is duplicated if necessary.
+
+ * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.cpp (duplicate):
+
+ Use the new iiop_endpoint() method to force the newly created
+ TAO_SSLIOP_Endpoint retain ownership of its TAO_IIOP_Endpoint
+ member. This fixes a segmentation fault that occurred when a
+ TAO_SSLIOP_Endpoint was duplicated, re-cached in the transport
+ cache, and then later checked for equivalence. The problem was
+ that the TAO_IIOP_Endpoint pointer member of the
+ TAO_SSLIOP_Endpoint was being "yanked out from under it" when
+ the TAO_SSLIOP_Profile that actually owned the TAO_IIOP_Endpoint
+ was destroyed.
+
+ (~TAO_SSLIOP_Endpoint):
+
+ Delete the iiop_endpoint_ member if the TAO_SSLIOP_Endpoint
+ "owns" it.
+
+ * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Profile.cpp (TAO_SSLIOP_Profile,
+ decode, decode_endpoints):
+
+ Use the new TAO_SSLIOP_Endpoint::iiop_endpoint() mutator method
+ to force the TAO_SSLIOP_Endpoint to copy the given
+ TAO_IIOP_Endpoint, and thus retain ownership.
+
Thu Dec 13 13:42:28 2001 Carlos O'Ryan <coryan@uci.edu>
* orbsvcs/performance-tests/EC_Federated_Scalability/Coordinator.cpp:
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.cpp
index 140b5cf7878..11d076cf8b1 100644
--- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.cpp
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.cpp
@@ -19,7 +19,8 @@ TAO_SSLIOP_Endpoint::TAO_SSLIOP_Endpoint (const SSLIOP::SSL *ssl_component,
: TAO_Endpoint (IOP::TAG_INTERNET_IOP),
object_addr_ (),
next_ (0),
- iiop_endpoint_ (iiop_endp)
+ iiop_endpoint_ (iiop_endp),
+ destroy_iiop_endpoint_ (0)
{
if (ssl_component != 0)
{
@@ -72,6 +73,8 @@ TAO_SSLIOP_Endpoint::TAO_SSLIOP_Endpoint (const SSLIOP::SSL *ssl_component,
TAO_SSLIOP_Endpoint::~TAO_SSLIOP_Endpoint (void)
{
+ if (this->destroy_iiop_endpoint_)
+ delete this->iiop_endpoint_;
}
int
@@ -141,9 +144,11 @@ TAO_SSLIOP_Endpoint::duplicate (void)
ACE_NEW_RETURN (endpoint,
TAO_SSLIOP_Endpoint (&this->ssl_component_,
- this->iiop_endpoint_),
+ 0),
0);
+ endpoint->iiop_endpoint (this->iiop_endpoint_, 1);
+
return endpoint;
}
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.h
index f5d3d05782a..85a75f83561 100644
--- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.h
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.h
@@ -90,6 +90,14 @@ public:
/// Accessor to our IIOP counterpart.
TAO_IIOP_Endpoint *iiop_endpoint (void) const;
+ /// Mutator to our IIOP counterpart.
+ /**
+ * @param destroy If set to a non-zero value, then the
+ * TAO_SSLIOP_Endpoint object retains ownership of
+ * the given TAO_IIOP_Endpoint.
+ */
+ void iiop_endpoint (TAO_IIOP_Endpoint *endpoint, int destroy);
+
/// Return the SSLIOP-specific ACE_INET_Addr.
const ACE_INET_Addr &object_addr (void) const;
//@}
@@ -116,6 +124,10 @@ private:
*/
TAO_IIOP_Endpoint *iiop_endpoint_;
+ /// Flag that determines whether or not the iiop_endpoint_ member is
+ /// deallocated with delete().
+ int destroy_iiop_endpoint_;
+
};
#if defined (__ACE_INLINE__)
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.i b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.i
index daee33cac71..ec1a35c8fd0 100644
--- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.i
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.i
@@ -9,6 +9,33 @@ TAO_SSLIOP_Endpoint::iiop_endpoint (void) const
return this->iiop_endpoint_;
}
+ACE_INLINE void
+TAO_SSLIOP_Endpoint::iiop_endpoint (TAO_IIOP_Endpoint *iiop_endpoint,
+ int destroy)
+{
+ if (iiop_endpoint != 0)
+ {
+ TAO_IIOP_Endpoint *new_endpoint = 0;
+
+ if (destroy)
+ {
+ TAO_Endpoint *endpoint = iiop_endpoint->duplicate ();
+
+ new_endpoint = ACE_dynamic_cast (TAO_IIOP_Endpoint *,
+ endpoint);
+
+ }
+ else
+ new_endpoint = iiop_endpoint;
+
+ if (this->destroy_iiop_endpoint_)
+ delete this->iiop_endpoint_;
+
+ this->iiop_endpoint_ = new_endpoint;
+ this->destroy_iiop_endpoint_ = destroy;
+ }
+}
+
ACE_INLINE const SSLIOP::SSL &
TAO_SSLIOP_Endpoint::ssl_component (void) const
{
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Profile.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Profile.cpp
index c81563fa6b1..f923647772e 100644
--- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Profile.cpp
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Profile.cpp
@@ -26,7 +26,7 @@ TAO_SSLIOP_Profile::TAO_SSLIOP_Profile (const ACE_INET_Addr &addr,
orb_core),
ssl_endpoint_ (ssl_component, 0)
{
- this->ssl_endpoint_.iiop_endpoint_ = &this->endpoint_;
+ this->ssl_endpoint_.iiop_endpoint (&this->endpoint_, 1);
}
TAO_SSLIOP_Profile::TAO_SSLIOP_Profile (const char* host,
@@ -44,7 +44,7 @@ TAO_SSLIOP_Profile::TAO_SSLIOP_Profile (const char* host,
orb_core),
ssl_endpoint_ (ssl_component, 0)
{
- this->ssl_endpoint_.iiop_endpoint_ = &this->endpoint_;
+ this->ssl_endpoint_.iiop_endpoint (&this->endpoint_, 1);
}
TAO_SSLIOP_Profile::TAO_SSLIOP_Profile (TAO_ORB_Core *orb_core,
@@ -52,14 +52,14 @@ TAO_SSLIOP_Profile::TAO_SSLIOP_Profile (TAO_ORB_Core *orb_core,
: TAO_IIOP_Profile (orb_core),
ssl_endpoint_ (ssl_component, 0)
{
- this->ssl_endpoint_.iiop_endpoint_ = &this->endpoint_;
+ this->ssl_endpoint_.iiop_endpoint (&this->endpoint_, 1);
}
TAO_SSLIOP_Profile::TAO_SSLIOP_Profile (TAO_ORB_Core *orb_core)
: TAO_IIOP_Profile (orb_core),
ssl_endpoint_ (0, 0)
{
- this->ssl_endpoint_.iiop_endpoint_ = &this->endpoint_;
+ this->ssl_endpoint_.iiop_endpoint (&this->endpoint_, 1);
}
TAO_SSLIOP_Profile::~TAO_SSLIOP_Profile (void)
@@ -117,9 +117,8 @@ TAO_SSLIOP_Profile::decode (TAO_InputCDR& cdr)
{
// This profile contains only one endpoint. Finish initializing
// it.
- this->ssl_endpoint_.iiop_endpoint_ = &this->endpoint_;
- this->ssl_endpoint_.priority
- (this->ssl_endpoint_.iiop_endpoint_->priority ());
+ this->ssl_endpoint_.iiop_endpoint (&this->endpoint_, 1);
+ this->ssl_endpoint_.priority (this->endpoint_.priority ());
return 1;
}
else
@@ -159,7 +158,7 @@ TAO_SSLIOP_Profile::decode (TAO_InputCDR& cdr)
ssl_endp != 0;
ssl_endp = ssl_endp->next_)
{
- ssl_endp->iiop_endpoint_ = iiop_endp;
+ ssl_endp->iiop_endpoint (iiop_endp, 1);
ssl_endp->priority (iiop_endp->priority ());
iiop_endp = iiop_endp->next_;
}
@@ -317,7 +316,7 @@ TAO_SSLIOP_Profile::decode_endpoints (void)
ssl_endp != 0;
ssl_endp = ssl_endp->next_)
{
- ssl_endp->iiop_endpoint_ = iiop_endp;
+ ssl_endp->iiop_endpoint (iiop_endp, 1);
ssl_endp->priority (iiop_endp->priority ());
iiop_endp = iiop_endp->next_;
}