summaryrefslogtreecommitdiff
path: root/TAO
diff options
context:
space:
mode:
authormarina <marina@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-09-29 06:29:11 +0000
committermarina <marina@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-09-29 06:29:11 +0000
commit9dbb37da43be2487d3fa2b10ead123ffcf8eaa4e (patch)
tree6106263e88f658630557858e5d4f09125c95e940 /TAO
parentb2c4086d93ff4674c17dd147ce53170c6b0469dc (diff)
downloadATCD-9dbb37da43be2487d3fa2b10ead123ffcf8eaa4e.tar.gz
ChangeLogTag:Fri Sep 29 01:27:26 2000 Marina Spivak <marina@cs.wustl.edu>
Diffstat (limited to 'TAO')
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.cpp96
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.h8
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connect.cpp38
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connect.h22
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp12
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.h9
-rw-r--r--TAO/tao/IIOP_Acceptor.h8
-rw-r--r--TAO/tao/IIOP_Connector.h8
8 files changed, 62 insertions, 139 deletions
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.cpp
index ded610edc44..db94781f9d0 100644
--- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.cpp
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.cpp
@@ -383,9 +383,6 @@ TAO_SSLIOP_Acceptor::open_i (TAO_ORB_Core* orb_core,
{
this->orb_core_ = orb_core;
- if (this->init_tcp_properties () != 0)
- return -1;
-
int giop_lite = 0;
// Explicitly disable GIOPlite support since it introduces security
// holes.
@@ -581,97 +578,4 @@ TAO_SSLIOP_Acceptor::parse_options (const char *str)
return 0;
}
-int
-TAO_SSLIOP_Acceptor::init_tcp_properties (void)
-{
-#if (TAO_HAS_RT_CORBA == 1)
-
- // @@ Currently (in the code below), we obtain protocol properties from
- // ORB-level ServerProtocol, even though the policy may
- // have been overridden on POA level. That's because currently all
- // endpoints (acceptors) are global. Once endpoints become per POA,
- // the code below will have to be changed to look at the POA-level
- // ServerProtocol policy first.
-
- // @@ Later we may want to factor some of the code below
- // among different protocols and place it into TAO_Acceptor, for
- // example.
-
- // ServerProtocolProperties policy controls protocols configuration.
- // Look for protocol properties in the effective ServerProtocolPolicy.
- TAO_ServerProtocolPolicy *server_protocols =
- this->orb_core_->server_protocol ();
- // Automatically release the policy.
- CORBA::Object_var auto_release = server_protocols;
- RTCORBA::TCPProtocolProperties_var tcp_properties =
- RTCORBA::TCPProtocolProperties::_nil ();
- RTCORBA::ProtocolList & protocols = server_protocols->protocols_rep ();
-
- // Find protocol properties for TCP.
- ACE_DECLARE_NEW_CORBA_ENV;
- for (CORBA::ULong j = 0; j < protocols.length (); ++j)
- if (protocols[j].protocol_type == TAO_TAG_IIOP_PROFILE)
- {
- tcp_properties =
- RTCORBA::TCPProtocolProperties::_narrow
- (protocols[j].transport_protocol_properties.in (),
- ACE_TRY_ENV);
- ACE_CHECK_RETURN (-1);
- break;
- }
-
- if (CORBA::is_nil (tcp_properties.in ()))
- {
- // TCP Properties were not specified in the effective policy.
- // We must use orb defaults.
-
- server_protocols = this->orb_core_->default_server_protocol ();
- // Automatically release the policy.
- auto_release = server_protocols;
- // Find protocol properties for IIOP.
- RTCORBA::ProtocolList & protocols = server_protocols->protocols_rep ();
- for (CORBA::ULong j = 0; j < protocols.length (); ++j)
- if (protocols[j].protocol_type == TAO_TAG_IIOP_PROFILE)
- {
- tcp_properties =
- RTCORBA::TCPProtocolProperties::_narrow
- (protocols[j].transport_protocol_properties.in (),
- ACE_TRY_ENV);
- ACE_CHECK_RETURN (-1);
- break;
- }
-
- // Orb defaults should never be null, since the ORB initializes
- // them in ORB_init ...
- }
-
- // Extract and locally store properties of interest.
- this->tcp_properties_.send_buffer_size =
- tcp_properties->send_buffer_size ();
- this->tcp_properties_.recv_buffer_size =
- tcp_properties->recv_buffer_size ();
- this->tcp_properties_.no_delay =
- tcp_properties->no_delay ();
-
- // @@ NOTE. RTCORBA treats a combination of transport+messaging
- // as a single protocol. Keep this in mind for when we adopt
- // RTCORBA approach to protocols configuration for nonRT use. In
- // particular, what are the semantics of independent variation of
- // messaging and transport layers, when one transport appears in
- // combination with several messaging protocols, for example.
-
-#else /* TAO_HAS_RT_CORBA == 1 */
-
- this->tcp_properties_.send_buffer_size =
- this->orb_core_->orb_params ()->sock_sndbuf_size ();
- this->tcp_properties_.recv_buffer_size =
- this->orb_core_->orb_params ()->sock_rcvbuf_size ();
- this->tcp_properties_.no_delay =
- this->orb_core_->orb_params ()->nodelay ();
-
-#endif /* TAO_HAS_RT_CORBA == 1 */
-
- return 0;
-}
-
#endif /* ACE_HAS_SSL */
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.h
index 3515d64783c..bebd485cc24 100644
--- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.h
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.h
@@ -82,10 +82,6 @@ private:
int parse_options (const char *options);
// Parse protocol specific options.
- int init_tcp_properties (void);
- // Obtain TCP properties that must be used by this acceptor, i.e.,
- // initialize <tcp_properties_>.
-
int create_rt_mprofile (const TAO_ObjectKey &object_key,
TAO_MProfile &mprofile);
// Rather than creating a separate profile for each endpoint, this
@@ -104,10 +100,6 @@ private:
SSLIOP::SSL ssl_component_;
// The SSL component.
-
- TAO_SSLIOP_Handler_Base::TCP_Properties tcp_properties_;
- // TCP configuration properties to be used for all connections
- // opened by this acceptor.
};
#if defined(__ACE_INLINE__)
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connect.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connect.cpp
index 9ce385bf37c..d0b47e61b33 100644
--- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connect.cpp
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connect.cpp
@@ -363,12 +363,24 @@ TAO_SSLIOP_Server_Connection_Handler::handle_input_i (ACE_HANDLE,
// transport obj.
TAO_SSLIOP_Client_Connection_Handler::
+TAO_SSLIOP_Client_Connection_Handler (ACE_Thread_Manager *t)
+ : TAO_SSLIOP_Handler_Base (t),
+ transport_ (this, 0),
+ orb_core_ (0)
+{
+ // This constructor should *never* get called. See comments in .h
+ ACE_ASSERT (this->orb_core_ != 0);
+}
+
+TAO_SSLIOP_Client_Connection_Handler::
TAO_SSLIOP_Client_Connection_Handler (ACE_Thread_Manager *t,
TAO_ORB_Core* orb_core,
CORBA::Boolean /* flag */)
: TAO_SSLIOP_Handler_Base (t),
transport_ (this, orb_core),
- orb_core_ (orb_core)
+ orb_core_ (orb_core),
+ tcp_properties_ (ACE_static_cast
+ (TAO_IIOP_Handler_Base::TCP_Properties *, arg))
{
// The flag that is used to enable GIOPlite is *not* used for
// SSLIOP. GIOPlite introduces security holes. It should not be
@@ -392,38 +404,28 @@ TAO_SSLIOP_Client_Connection_Handler::~TAO_SSLIOP_Client_Connection_Handler (voi
int
TAO_SSLIOP_Client_Connection_Handler::open (void *)
{
- // @@ TODO: This flags should be set using the RT CORBA policies...
-
- // Here is where we could enable all sorts of things such as
- // nonblock I/O, sock buf sizes, TCP no-delay, etc.
-
#if !defined (ACE_LACKS_SOCKET_BUFSIZ)
- int sndbufsize =
- this->orb_core_->orb_params ()->sock_sndbuf_size ();
- int rcvbufsize =
- this->orb_core_->orb_params ()->sock_rcvbuf_size ();
if (this->peer ().set_option (SOL_SOCKET,
SO_SNDBUF,
- ACE_reinterpret_cast (void *, &sndbufsize),
- sizeof (sndbufsize)) == -1
+ (void *) &tcp_properties_->send_buffer_size,
+ sizeof (int)) == -1
&& errno != ENOTSUP)
return -1;
else if (this->peer ().set_option (SOL_SOCKET,
SO_RCVBUF,
- ACE_reinterpret_cast (void *, &rcvbufsize),
- sizeof (rcvbufsize)) == -1
+ (void *) &tcp_properties_->recv_buffer_size,
+ sizeof (int)) == -1
&& errno != ENOTSUP)
return -1;
#endif /* ACE_LACKS_SOCKET_BUFSIZ */
#if !defined (ACE_LACKS_TCP_NODELAY)
- int nodelay =
- this->orb_core_->orb_params ()->nodelay ();
+
if (this->peer ().set_option (ACE_IPPROTO_TCP,
TCP_NODELAY,
- (void *) &nodelay,
- sizeof (nodelay)) == -1)
+ (void *) &tcp_properties_->no_delay,
+ sizeof (int)) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("NODELAY failed\n")),
-1);
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connect.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connect.h
index 8ba6bc14556..5ba4dea20d4 100644
--- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connect.h
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connect.h
@@ -74,10 +74,21 @@ class TAO_SSLIOP_Export TAO_SSLIOP_Client_Connection_Handler : public TAO_SSLIOP
// <Svc_Handler> used on the client side and returned by the
// <TAO_CONNECTOR>.
public:
- // = Initialization method.
- TAO_SSLIOP_Client_Connection_Handler (ACE_Thread_Manager *t = 0,
- TAO_ORB_Core* orb_core = 0,
- CORBA::Boolean flag = 0);
+ // = Initialization methods.
+
+ TAO_SSLIOP_Client_Connection_Handler (ACE_Thread_Manager* t = 0);
+ // This constructor should *never* get called, it is just here to
+ // make the compiler happy: the default implementation of the
+ // Creation_Strategy requires a constructor with that signature, we
+ // don't use that implementation, but some (most?) compilers
+ // instantiate it anyway.
+
+ TAO_SSLIOP_Client_Connection_Handler (ACE_Thread_Manager *t,
+ TAO_ORB_Core* orb_core,
+ CORBA::Boolean flag,
+ void *arg);
+ // Constructor. <arg> parameter is used by the Connector to pass the
+ // protocol configuration properties for this connection.
virtual ~TAO_SSLIOP_Client_Connection_Handler (void);
@@ -117,6 +128,9 @@ protected:
TAO_ORB_Core *orb_core_;
// Cached ORB Core.
+
+ TCP_Properties *tcp_properties_;
+ // TCP configuration for this connection.
};
// ****************************************************************
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp
index ff890100d7e..b81b856a727 100644
--- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp
@@ -318,9 +318,11 @@ template class ACE_Refcounted_Recyclable_Handler_Caching_Utility<TAO_ADDR, TAO_C
TAO_SSLIOP_Connect_Creation_Strategy::
TAO_SSLIOP_Connect_Creation_Strategy (ACE_Thread_Manager* t,
- TAO_ORB_Core *orb_core)
+ TAO_ORB_Core *orb_core,
+ void *arg)
: ACE_Creation_Strategy<TAO_SSLIOP_Client_Connection_Handler> (t),
- orb_core_ (orb_core)
+ orb_core_ (orb_core),
+ arg_ (arg)
{
}
@@ -332,7 +334,8 @@ TAO_SSLIOP_Connect_Creation_Strategy::make_svc_handler
ACE_NEW_RETURN (sh,
TAO_SSLIOP_Client_Connection_Handler
(this->orb_core_->thr_mgr (),
- this->orb_core_),
+ this->orb_core_,
+ this->arg_),
-1);
return 0;
}
@@ -369,7 +372,8 @@ TAO_SSLIOP_Connector::open (TAO_ORB_Core *orb_core)
ACE_NEW_RETURN (connect_creation_strategy,
TAO_SSLIOP_Connect_Creation_Strategy
(this->orb_core_->thr_mgr (),
- this->orb_core_),
+ this->orb_core_,
+ &(this->tcp_properties_)),
-1);
auto_ptr<TAO_SSLIOP_Connect_Creation_Strategy>
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.h
index 97610d245bb..ea7b3aab96e 100644
--- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.h
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.h
@@ -62,7 +62,11 @@ class TAO_SSLIOP_Export TAO_SSLIOP_Connect_Creation_Strategy : public ACE_Creati
//
public:
TAO_SSLIOP_Connect_Creation_Strategy (ACE_Thread_Manager * = 0,
- TAO_ORB_Core* orb_core = 0);
+ TAO_ORB_Core* orb_core = 0,
+ void *arg = 0);
+ // Constructor. <arg> parameter is used to pass any special
+ // state/info to the service handler upon creation. Currently used
+ // to pass protocol configuration properties.
virtual int make_svc_handler (TAO_SSLIOP_Client_Connection_Handler *&sh);
// Makes TAO_SSLIOP_Client_Connection_Handlers
@@ -70,6 +74,9 @@ public:
private:
TAO_ORB_Core* orb_core_;
// The ORB
+
+ void *arg_;
+ // Some info/state to be passed to the service handler we create.
};
// ****************************************************************
diff --git a/TAO/tao/IIOP_Acceptor.h b/TAO/tao/IIOP_Acceptor.h
index a28e943909b..992d3e4c48f 100644
--- a/TAO/tao/IIOP_Acceptor.h
+++ b/TAO/tao/IIOP_Acceptor.h
@@ -130,6 +130,10 @@ protected:
TAO_ORB_Core *orb_core_;
// ORB Core.
+ TAO_IIOP_Handler_Base::TCP_Properties tcp_properties_;
+ // TCP configuration properties to be used for all
+ // connections opened by this acceptor.
+
private:
TAO_IIOP_BASE_ACCEPTOR base_acceptor_;
// the concrete acceptor, as a pointer to it's base class.
@@ -141,10 +145,6 @@ private:
CORBA::Boolean lite_flag_;
// Should we use GIOP lite??
-
- TAO_IIOP_Handler_Base::TCP_Properties tcp_properties_;
- // TCP configuration properties to be used for all
- // connections opened by this acceptor.
};
#if defined(__ACE_INLINE__)
diff --git a/TAO/tao/IIOP_Connector.h b/TAO/tao/IIOP_Connector.h
index b0a33d978f8..536eab7df3d 100644
--- a/TAO/tao/IIOP_Connector.h
+++ b/TAO/tao/IIOP_Connector.h
@@ -211,6 +211,10 @@ protected:
TAO_ORB_Core *orb_core_;
// ORB Core.
+ TAO_IIOP_Handler_Base::TCP_Properties tcp_properties_;
+ // TCP configuration properties to be used for all
+ // connections established by this connector.
+
private:
TAO_NULL_ACTIVATION_STRATEGY null_activation_strategy_;
TAO_NULL_CREATION_STRATEGY null_creation_strategy_;
@@ -229,10 +233,6 @@ private:
// Caching strategy which decides the order of removal of entries
// from the connection cache.
#endif /* TAO_USES_ROBUST_CONNECTION_MGMT */
-
- TAO_IIOP_Handler_Base::TCP_Properties tcp_properties_;
- // TCP configuration properties to be used for all
- // connections established by this connector.
};
#include "ace/post.h"