summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Mesnier <mesnier_p@ociweb.com>2005-02-04 21:14:48 +0000
committerPhil Mesnier <mesnier_p@ociweb.com>2005-02-04 21:14:48 +0000
commit607e7d09cd522cd387731530475d52ba0800253a (patch)
treeb891613b26b5889d3afd20092e9f627ff5e5d4d4
parentf5b5e3b447b340298304bf39ea2b2202b0101daf (diff)
downloadATCD-607e7d09cd522cd387731530475d52ba0800253a.tar.gz
ChangeLog tag: Fri Feb 4 15:09:22 2005 Phil Mesnier <mesnier_p@ociweb.com>
-rw-r--r--TAO/ChangeLog12
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp4
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.cpp38
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.h14
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.i21
5 files changed, 51 insertions, 38 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index f2589557598..335d1b19492 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,15 @@
+Fri Feb 4 15:09:22 2005 Phil Mesnier <mesnier_p@ociweb.com>
+
+ * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp:
+ * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.cpp:
+ * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.h:
+ * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.i:
+
+ In an effort to resolve multithreaded issues in the SSLIOP
+ connector, the assignment of security attributes to the endpoint
+ are now guarded by the same lock used to guard access to these
+ parameters.
+
Fri Feb 4 11:17:32 2005 Ossama Othman <ossama@dre.vanderbilt.edu>
* tao/Profile.cpp (TAO_Profile):
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp
index ca582e1b9c1..0c7b47d751a 100644
--- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp
@@ -533,9 +533,7 @@ TAO::SSLIOP::Connector::ssliop_connect (
ACE_CHECK_RETURN (0);
svc_handler = safe_handler.release ();
- ssl_endpoint->qop (qop);
- ssl_endpoint->trust (trust);
- ssl_endpoint->credentials (credentials.in ());
+ ssl_endpoint->set_sec_attrs (qop, trust, credentials.in());
}
// Check the Cache first for connections
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.cpp
index e8944491b8c..e4aeefc2c09 100644
--- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.cpp
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.cpp
@@ -154,20 +154,21 @@ TAO_SSLIOP_Endpoint::duplicate (void)
0),
0);
- endpoint->qop (this->qop_);
- endpoint->trust (this->trust_);
- endpoint->credentials (this->credentials_.in ()); // Shallow copy
-
- endpoint->credentials_set_ = this->credentials_set_;
+ if (this->credentials_set_)
+ endpoint->set_sec_attrs (this->qop_,this->trust_, this->credentials_.in());
endpoint->iiop_endpoint (this->iiop_endpoint_, true);
-
+ endpoint->hash_val_ = this->hash_val_;
return endpoint;
}
CORBA::ULong
TAO_SSLIOP_Endpoint::hash (void)
{
+ // there is actually the potential for a race of the inverse case,
+ // since setting the security attributes will reset the hash_val_,
+ // it is possible this test to pass, but then have the hash reset
+ // before the value is returned.
if (this->hash_val_ != 0)
return this->hash_val_;
@@ -223,3 +224,28 @@ TAO_SSLIOP_Endpoint::object_addr (void) const
return this->object_addr_;
}
+
+void
+TAO_SSLIOP_Endpoint::set_sec_attrs (::Security::QOP q,
+ const ::Security::EstablishTrust &t,
+ const TAO::SSLIOP::OwnCredentials_ptr c)
+{
+ if (this->credentials_set_)
+ return;
+
+ ACE_GUARD (TAO_SYNCH_MUTEX,
+ guard,
+ this->addr_lookup_lock_);
+
+ // double-check
+ if (this->credentials_set_)
+ return;
+
+ this->qop_ = q;
+ this->trust_ = t;
+ this->credentials_ = TAO::SSLIOP::OwnCredentials::_duplicate (c);
+ this->credentials_set_ = 1;
+
+ // reset the hash value to force a recomputation.
+ this->hash_val_ = 0;
+}
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.h
index 2f08eb79fe7..54d41697a44 100644
--- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.h
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.h
@@ -110,21 +110,19 @@ namespace TAO
/// Return the SSLIOP-specific ACE_INET_Addr.
const ACE_INET_Addr &object_addr (void) const;
- /// Set the Quality-of-Protection settings for this endpoint.
- void qop (::Security::QOP qop);
+ /// Set the Quality-of-Protection, establishment of trust, and
+ /// credentials for this endpoint. This is all done in one function
+ /// so that the guard may be used uniformly.
+ void set_sec_attrs (::Security::QOP qop,
+ const ::Security::EstablishTrust &trust,
+ TAO::SSLIOP::OwnCredentials_ptr creds);
/// Get the Quality-of-Protection settings for this endpoint.
::Security::QOP qop (void) const;
- /// Set the establishment of trust settings for this endpoint.
- void trust (const ::Security::EstablishTrust &trust);
-
/// Get the establishment of trust settings for this endpoint.
::Security::EstablishTrust trust (void) const;
- /// Set the credentials for this endpoint.
- void credentials (TAO::SSLIOP::OwnCredentials_ptr creds);
-
/// Get the credentials for this endpoint.
/**
* @note This method does not follow C++ mapping memory
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.i b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.i
index 44c6e3abcad..9b9f9e4d585 100644
--- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.i
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.i
@@ -41,39 +41,18 @@ TAO_SSLIOP_Endpoint::ssl_component (void) const
return this->ssl_component_;
}
-
-
-ACE_INLINE void
-TAO_SSLIOP_Endpoint::qop (::Security::QOP q)
-{
- this->qop_ = q;
-}
-
ACE_INLINE ::Security::QOP
TAO_SSLIOP_Endpoint::qop (void) const
{
return this->qop_;
}
-ACE_INLINE void
-TAO_SSLIOP_Endpoint::trust (const ::Security::EstablishTrust &t)
-{
- this->trust_ = t;
-}
-
ACE_INLINE ::Security::EstablishTrust
TAO_SSLIOP_Endpoint::trust (void) const
{
return this->trust_;
}
-ACE_INLINE void
-TAO_SSLIOP_Endpoint::credentials (const TAO::SSLIOP::OwnCredentials_ptr creds)
-{
- this->credentials_ = TAO::SSLIOP::OwnCredentials::_duplicate (creds);
- this->credentials_set_ = 1;
-}
-
ACE_INLINE TAO::SSLIOP::OwnCredentials *
TAO_SSLIOP_Endpoint::credentials (void) const
{