diff options
31 files changed, 174 insertions, 274 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 400b10f231a..8a8e67f2080 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,49 @@ +Thu Sep 30 16:53:48 2004 Irfan Pyarali <irfan@oomworks.com> + + * tao\Protocols_Hooks.h: + + Added export directives to the class declarations. + + * tao\Connection_Handler.{h,inl} (TAO_Connection_Handler): + + Gave the set_dscp_codepoint() method a default no-op + implementation. This way local protocols will not have to + bother overwritting this method. + + * tao\Strategies\UIOP_Connection_Handler.{h,cpp}: + * tao\Strategies\SHMIOP_Connection_Handler.{h,cpp}: + + Removed no-op implementation of set_dscp_codepoint(). + + * orbsvcs\orbsvcs\SSLIOP\SSLIOP_Util.{h,cpp}: + + SSLIOP::Util::setup_handler_state no longer needed. However, a + helper for resolving the current is needed and was added. + + * orbsvcs\orbsvcs\PortableGroup\UIPMC_Acceptor.{h,cpp}: + * orbsvcs\orbsvcs\PortableGroup\UIPMC_Connector.{h,cpp}: + * orbsvcs\orbsvcs\SSLIOP\IIOP_SSL_Acceptor.{h,cpp}: + * orbsvcs\orbsvcs\SSLIOP\IIOP_SSL_Connector.{h,cpp}: + * orbsvcs\orbsvcs\SSLIOP\SSLIOP_Acceptor.{h,cpp}: + * orbsvcs\orbsvcs\SSLIOP\SSLIOP_Connector.{h,cpp}: + + The void * arg parameter that was being passed to + TAO_Creation_Strategy is no longer necessary. Service handlers + now figure out protocol properties when they are created. + + * orbsvcs\orbsvcs\PortableGroup\UIPMC_Connection_Handler.{h,cpp}: + * orbsvcs\orbsvcs\SSLIOP/IIOP_SSL_Connection_Handler.{h,cpp}: + * orbsvcs\orbsvcs\SSLIOP/SSLIOP_Connection_Handler.{h,cpp}: + + TAO_{Protocol Name}_Properties was removed. <arg> parameter + that was used to pass information between acceptor/connector and + service handler was removed. open() was modified to get the + protocol properties from the correct place. + + * orbsvcs\orbsvcs\FtRtEvent\EventChannel\Fault_Detector_Loader.cpp: + + Added missing semicolon. + Thu Sep 30 07:19:02 2004 J.T. Conklin <jtc@acorntoolworks.com> * Makefile.am: @@ -240,7 +286,7 @@ Wed Sep 29 17:30:25 2004 Irfan Pyarali <irfan@oomworks.com> * tao/IIOP_Acceptor.{h,cpp}: * tao/IIOP_Connector.{h,cpp}: - - The void * arg parameter that was being passed to + The void * arg parameter that was being passed to TAO_Creation_Strategy is no longer necessary. Service handlers now figure out protocol properties when they are created. diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Fault_Detector_Loader.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Fault_Detector_Loader.cpp index e10f0d406ba..0cb53c28f0b 100644 --- a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Fault_Detector_Loader.cpp +++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Fault_Detector_Loader.cpp @@ -47,7 +47,7 @@ namespace FTRTEC { if (argc > 0 && ACE_OS::strcasecmp (argv[0], ACE_LIB_TEXT("sctp")) == 0) { #if (TAO_HAS_SCIOP == 1) - ACE_AUTO_PTR_RESET(detector_, detector, Fault_Detector) + ACE_AUTO_PTR_RESET(detector_, detector, Fault_Detector); #else ACE_DEBUG ((LM_DEBUG, "(%P|%t) SCTP not enabled. ", diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Acceptor.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Acceptor.cpp index 2bd5d890996..c089762f6ac 100644 --- a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Acceptor.cpp +++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Acceptor.cpp @@ -18,8 +18,8 @@ #include "UIPMC_Acceptor.i" #endif /* __ACE_INLINE__ */ -ACE_RCSID (PortableGroup, - UIPMC_Acceptor, +ACE_RCSID (PortableGroup, + UIPMC_Acceptor, "$Id$") @@ -90,9 +90,6 @@ TAO_UIPMC_Acceptor::open (TAO_ORB_Core *orb_core, { this->orb_core_ = orb_core; - if (this->init_uipmc_properties () != 0) - return -1; - if (this->hosts_ != 0) { // The hostname cache has already been set! @@ -178,8 +175,7 @@ TAO_UIPMC_Acceptor::open_i (const ACE_INET_Addr& addr, ACE_Reactor *reactor) { ACE_NEW_RETURN (this->connection_handler_, - TAO_UIPMC_Connection_Handler (this->orb_core_, - 0 /* TAO_UIPMC_Properties */), + TAO_UIPMC_Connection_Handler (this->orb_core_), -1); this->connection_handler_->local_addr (addr); @@ -353,10 +349,3 @@ TAO_UIPMC_Acceptor::parse_options (const char *str) } return 0; } - -int -TAO_UIPMC_Acceptor::init_uipmc_properties (void) -{ - // @@ Michael: We use UDP, so we do not set TCP settings. - return 0; -} diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Acceptor.h b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Acceptor.h index 22f203370cb..a4a5c61647e 100644 --- a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Acceptor.h +++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Acceptor.h @@ -115,10 +115,6 @@ protected: /// Parse protocol specific options. virtual int parse_options (const char *options); - /// Obtain uipmc properties that must be used by this acceptor, i.e., - /// initialize <uipmc_properties_>. - int init_uipmc_properties (void); - protected: /// Array of ACE_INET_Addr instances, each one corresponding to a @@ -148,10 +144,6 @@ protected: /// ORB Core. TAO_ORB_Core *orb_core_; - /// UIPMC configuration properties to be used for all - /// connections opened by this acceptor. - TAO_UIPMC_Properties uipmc_properties_; - private: TAO_UIPMC_Connection_Handler *connection_handler_; diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connection_Handler.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connection_Handler.cpp index 870c1dd57e4..987f574ee80 100644 --- a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connection_Handler.cpp +++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connection_Handler.cpp @@ -30,8 +30,7 @@ TAO_UIPMC_Connection_Handler::TAO_UIPMC_Connection_Handler (ACE_Thread_Manager * TAO_Connection_Handler (0), udp_socket_ (ACE_sap_any_cast (ACE_INET_Addr &)), mcast_socket_ (), - using_mcast_ (0), - uipmc_properties_ (0) + using_mcast_ (0) { // This constructor should *never* get called, it is just here to // make the compiler happy: the default implementation of the @@ -42,15 +41,12 @@ TAO_UIPMC_Connection_Handler::TAO_UIPMC_Connection_Handler (ACE_Thread_Manager * } -TAO_UIPMC_Connection_Handler::TAO_UIPMC_Connection_Handler (TAO_ORB_Core *orb_core, - void *arg) +TAO_UIPMC_Connection_Handler::TAO_UIPMC_Connection_Handler (TAO_ORB_Core *orb_core) : TAO_UIPMC_SVC_HANDLER (orb_core->thr_mgr (), 0, 0), TAO_Connection_Handler (orb_core), udp_socket_ (ACE_sap_any_cast (ACE_INET_Addr &)), mcast_socket_ (), - using_mcast_ (0), - uipmc_properties_ (ACE_static_cast - (TAO_UIPMC_Properties *, arg)) + using_mcast_ (0) { TAO_UIPMC_Transport* specific_transport = 0; ACE_NEW(specific_transport, diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connection_Handler.h b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connection_Handler.h index 46f8abcbd0b..c388a08279c 100644 --- a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connection_Handler.h +++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connection_Handler.h @@ -39,25 +39,6 @@ class TAO_Pluggable_Messaging; // **************************************************************** /** - * @class TAO_UIPMC_Properties - * - * @brief UIPMC properties specification for a set of - * connections. - * - */ - -class TAO_PortableGroup_Export TAO_UIPMC_Properties -{ - -public: - int ttl; -}; - - - -// **************************************************************** - -/** * @class TAO_UIPMC_Connection_Handler * * @brief Handles requests on a single connection. @@ -78,8 +59,7 @@ public: /// Constructor. <arg> parameter is used by the Acceptor to pass the /// protocol configuration properties for this connection. - TAO_UIPMC_Connection_Handler (TAO_ORB_Core *orb_core, - void *arg); + TAO_UIPMC_Connection_Handler (TAO_ORB_Core *orb_core); /// Destructor. @@ -162,10 +142,6 @@ protected: virtual int release_os_resources (void); //@} -private: - - /// UIPMC configuration for this connection. - TAO_UIPMC_Properties *uipmc_properties_; }; diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connector.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connector.cpp index efd15ccd74f..9079b84e62e 100644 --- a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connector.cpp +++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connector.cpp @@ -158,8 +158,7 @@ TAO_UIPMC_Connector::make_connection (TAO::Profile_Transport_Resolver *, { TAO_UIPMC_Connection_Handler *svc_handler_i = 0; ACE_NEW_RETURN (svc_handler_i, - TAO_UIPMC_Connection_Handler (this->orb_core (), - 0 /* TAO_UIPMC_Properties */), + TAO_UIPMC_Connection_Handler (this->orb_core ()), 0); svc_handler_i->local_addr (ACE_sap_any_cast (ACE_INET_Addr &)); @@ -254,13 +253,6 @@ TAO_UIPMC_Connector::object_key_delimiter (void) const } int -TAO_UIPMC_Connector::init_uipmc_properties (void) -{ - // @@ Michael: We have no TCP, so we have no TCP properties. - return 0; -} - -int TAO_UIPMC_Connector::cancel_svc_handler ( TAO_Connection_Handler * svc_handler) { diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connector.h b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connector.h index 1a61217fe5f..ccb8ee68b7a 100644 --- a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connector.h +++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connector.h @@ -70,19 +70,9 @@ protected: virtual TAO_Profile * make_profile (ACE_ENV_SINGLE_ARG_DECL); - /// Obtain UIPMC properties that must be used by this connector, i.e., - /// initialize <uipmc_properties_>. - int init_uipmc_properties (void); - /// Cancel the passed cvs handler from the connector virtual int cancel_svc_handler (TAO_Connection_Handler * svc_handler); -protected: - - /// UIPMC configuration properties to be used for all - /// connections established by this connector. - TAO_UIPMC_Properties uipmc_properties_; - private: // @@ Michael: UDP Addition ACE_Hash_Map_Manager_Ex < ACE_INET_Addr, diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Acceptor.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Acceptor.cpp index 4ff4b3ce7cf..70e4efbad42 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Acceptor.cpp +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Acceptor.cpp @@ -1,7 +1,5 @@ #include "IIOP_SSL_Acceptor.h" -#include "SSLIOP_Util.h" - #include "tao/ORB_Core.h" #include "tao/debug.h" @@ -41,8 +39,7 @@ TAO::IIOP_SSL_Acceptor::IIOP_SSL_Acceptor (CORBA::Boolean flag) base_acceptor_ (), creation_strategy_ (0), concurrency_strategy_ (0), - accept_strategy_ (0), - handler_state_ () + accept_strategy_ (0) { } @@ -67,14 +64,8 @@ int TAO::IIOP_SSL_Acceptor::open_i (const ACE_INET_Addr& addr, ACE_Reactor *reactor) { - if (SSLIOP::Util::setup_handler_state (this->orb_core_, - &(this->tcp_properties_), - this->handler_state_) != 0) - return -1; - ACE_NEW_RETURN (this->creation_strategy_, TAO_IIOP_SSL_CREATION_STRATEGY (this->orb_core_, - &(this->handler_state_), this->lite_flag_), -1); diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Acceptor.h b/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Acceptor.h index 4d8e9a03e30..4259597b460 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Acceptor.h +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Acceptor.h @@ -24,7 +24,6 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "SSLIOP_Connection_Handler.h" #include "tao/IIOP_Acceptor.h" namespace TAO @@ -82,10 +81,6 @@ namespace TAO TAO_IIOP_SSL_ACCEPT_STRATEGY *accept_strategy_; //@} - /// State that will be passed to each SSLIOP connection handler upon - /// creation. - SSLIOP::Connection_Handler_State handler_state_; - }; } // End TAO namespace. diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Connection_Handler.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Connection_Handler.cpp index e7238c07a28..bd27221202e 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Connection_Handler.cpp +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Connection_Handler.cpp @@ -65,20 +65,13 @@ TAO::IIOP_SSL_Connection_Handler::IIOP_SSL_Connection_Handler ( TAO::IIOP_SSL_Connection_Handler::IIOP_SSL_Connection_Handler ( TAO_ORB_Core *orb_core, - CORBA::Boolean /*flag*/, - void *arg) - : TAO_IIOP_Connection_Handler ( - orb_core, - (static_cast<TAO::SSLIOP::Connection_Handler_State *> (arg))->tcp_properties) + CORBA::Boolean /* flag */) + : TAO_IIOP_Connection_Handler (orb_core, 0) { - TAO::SSLIOP::Connection_Handler_State *s = - static_cast<TAO::SSLIOP::Connection_Handler_State *> (arg); - IIOP_SSL_Transport* specific_transport = 0; ACE_NEW (specific_transport, IIOP_SSL_Transport (this, orb_core, - s->ssliop_current.in (), 0)); // Delete the transport with TAO_IIOP_Connection_Handler. diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Connection_Handler.h b/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Connection_Handler.h index d4da8a87a43..0f9389753c7 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Connection_Handler.h +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Connection_Handler.h @@ -52,8 +52,7 @@ namespace TAO /// Constructor. IIOP_SSL_Connection_Handler (ACE_Thread_Manager* t = 0); IIOP_SSL_Connection_Handler (TAO_ORB_Core *orb_core, - CORBA::Boolean flag, - void *arg); + CORBA::Boolean flag); /// Destructor. ~IIOP_SSL_Connection_Handler (void); diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Connector.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Connector.cpp index b2c65d931e1..e4236c18029 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Connector.cpp +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Connector.cpp @@ -1,7 +1,5 @@ #include "IIOP_SSL_Connector.h" -#include "SSLIOP_Util.h" - #include "tao/debug.h" #include "tao/ORB_Core.h" #include "tao/Environment.h" @@ -63,21 +61,12 @@ TAO::IIOP_SSL_Connector::open (TAO_ORB_Core *orb_core) if (this->create_connect_strategy () == -1) return -1; - if (this->init_tcp_properties () != 0) - return -1; - - if (TAO::SSLIOP::Util::setup_handler_state (orb_core, - &(this->tcp_properties_), - this->handler_state_) != 0) - return -1; - // Our connect creation strategy CONNECT_CREATION_STRATEGY *connect_creation_strategy = 0; ACE_NEW_RETURN (connect_creation_strategy, CONNECT_CREATION_STRATEGY (orb_core->thr_mgr (), orb_core, - &(this->handler_state_), this->lite_flag_), -1); diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Connector.h b/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Connector.h index ab1b6449ec6..87b3f5b280c 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Connector.h +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Connector.h @@ -24,7 +24,6 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "SSLIOP_Connection_Handler.h" #include "tao/IIOP_Connector.h" namespace TAO @@ -92,11 +91,6 @@ namespace TAO /// The connector initiating connection requests for IIOP_SSL. BASE_CONNECTOR base_connector_; - - /// State that will be passed to each SSLIOP connection handler upon - /// creation. - TAO::SSLIOP::Connection_Handler_State handler_state_; - }; } // End TAO namespace. diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Transport.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Transport.cpp index 7c81753642a..9fa051b7821 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Transport.cpp +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Transport.cpp @@ -1,5 +1,6 @@ #include "IIOP_SSL_Transport.h" #include "IIOP_SSL_Connection_Handler.h" +#include "SSLIOP_Util.h" #include "tao/ORB_Core.h" #include "tao/ORB.h" @@ -15,13 +16,13 @@ ACE_RCSID (SSLIOP, TAO::IIOP_SSL_Transport::IIOP_SSL_Transport ( IIOP_SSL_Connection_Handler *handler, TAO_ORB_Core *orb_core, - TAO::SSLIOP::Current_ptr current, CORBA::Boolean flag) : TAO_IIOP_Transport (handler, orb_core, - flag), - current_ (TAO::SSLIOP::Current::_duplicate (current)) + flag) { + this->current_ = + TAO::SSLIOP::Util::current (orb_core); } TAO::IIOP_SSL_Transport::~IIOP_SSL_Transport (void) diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Transport.h b/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Transport.h index aa4cdedd41c..1cd2555976b 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Transport.h +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Transport.h @@ -59,7 +59,6 @@ namespace TAO /// Constructor. IIOP_SSL_Transport (IIOP_SSL_Connection_Handler *handler, TAO_ORB_Core *orb_core, - TAO::SSLIOP::Current_ptr current, CORBA::Boolean flag = 0); /// Default destructor. diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.cpp index 49f67043231..79e31d76962 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.cpp +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.cpp @@ -1,7 +1,6 @@ #include "SSLIOP_Acceptor.h" #include "SSLIOP_Profile.h" #include "SSLIOP_Current.h" -#include "SSLIOP_Util.h" #include "tao/MProfile.h" #include "tao/ORB_Core.h" @@ -49,7 +48,6 @@ TAO::SSLIOP::Acceptor::Acceptor (::Security::QOP qop, creation_strategy_ (0), concurrency_strategy_ (0), accept_strategy_ (0), - handler_state_ (), timeout_ (timeout) { // --- CSIv1 --- @@ -187,7 +185,7 @@ TAO::SSLIOP::Acceptor::create_new_profile (const TAO::ObjectKey &object_key, pfile->tagged_components ().set_orb_type (TAO_ORB_TYPE); this->orb_core_->codeset_manager ()-> - set_codeset (pfile->tagged_components()); + set_codeset (pfile->tagged_components()); IOP::TaggedComponent component; component.tag = ::SSLIOP::TAG_SSL_SEC_TRANS; @@ -470,14 +468,8 @@ TAO::SSLIOP::Acceptor::ssliop_open_i (TAO_ORB_Core *orb_core, // holes. static const int giop_lite = 0; - if (TAO::SSLIOP::Util::setup_handler_state (this->orb_core_, - &(this->tcp_properties_), - this->handler_state_) != 0) - return -1; - ACE_NEW_RETURN (this->creation_strategy_, CREATION_STRATEGY (this->orb_core_, - &(this->handler_state_), giop_lite), -1); diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.h index 35c7786ddc8..9884acced94 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.h +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.h @@ -143,10 +143,6 @@ namespace TAO */ CSIIOP::TLS_SEC_TRANS csiv2_component_; - /// State that will be passed to each SSLIOP connection handler upon - /// creation. - Connection_Handler_State handler_state_; - /// The accept() timeout. /** * This timeout includes the overall time to complete the SSL diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.cpp index 980a4d6cf68..744e38ea1d8 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.cpp +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.cpp @@ -1,5 +1,6 @@ #include "SSLIOP_Connection_Handler.h" #include "SSLIOP_Endpoint.h" +#include "SSLIOP_Util.h" #include "tao/debug.h" #include "tao/Base_Transport_Property.h" @@ -9,6 +10,7 @@ #include "tao/Transport_Cache_Manager.h" #include "tao/Thread_Lane_Resources.h" #include "tao/Wait_Strategy.h" +#include "tao/Protocols_Hooks.h" #include "ace/os_include/netinet/os_tcp.h" #include "ace/os_include/os_netdb.h" @@ -26,8 +28,7 @@ TAO::SSLIOP::Connection_Handler::Connection_Handler ( ACE_Thread_Manager *t) : SVC_HANDLER (t, 0 , 0), TAO_Connection_Handler (0), - current_ (), - tcp_properties_ (0) + current_ () { // This constructor should *never* get called, it is just here to // make the compiler happy: the default implementation of the @@ -39,18 +40,13 @@ TAO::SSLIOP::Connection_Handler::Connection_Handler ( TAO::SSLIOP::Connection_Handler::Connection_Handler ( TAO_ORB_Core *orb_core, - CORBA::Boolean /* flag */, // SSLIOP does *not* support GIOPlite - void *arg) + CORBA::Boolean /* flag */) // SSLIOP does *not* support GIOPlite : SVC_HANDLER (orb_core->thr_mgr (), 0, 0), TAO_Connection_Handler (orb_core), - current_ (), - tcp_properties_ (0) + current_ () { - TAO::SSLIOP::Connection_Handler_State *s = - static_cast<TAO::SSLIOP::Connection_Handler_State *> (arg); - - this->tcp_properties_ = s->tcp_properties; - this->current_ = s->ssliop_current; + this->current_ = + TAO::SSLIOP::Util::current (orb_core); TAO::SSLIOP::Transport* specific_transport = 0; ACE_NEW (specific_transport, @@ -60,7 +56,6 @@ TAO::SSLIOP::Connection_Handler::Connection_Handler ( this->transport (specific_transport); } - TAO::SSLIOP::Connection_Handler::~Connection_Handler (void) { delete this->transport (); @@ -75,15 +70,37 @@ TAO::SSLIOP::Connection_Handler::open_handler (void *v) int TAO::SSLIOP::Connection_Handler::open (void *) { + TAO_IIOP_Protocol_Properties protocol_properties; + + // Initialize values from ORB params. + protocol_properties.send_buffer_size_ = + this->orb_core ()->orb_params ()->sock_sndbuf_size (); + protocol_properties.recv_buffer_size_ = + this->orb_core ()->orb_params ()->sock_rcvbuf_size (); + protocol_properties.no_delay_ = + this->orb_core ()->orb_params ()->nodelay (); + + TAO_Protocols_Hooks *tph = + this->orb_core ()->get_protocols_hooks (); + + int client = + this->transport ()->opened_as () == TAO::TAO_CLIENT_ROLE;; + + if (client) + tph->client_protocol_properties_at_orb_level (protocol_properties); + else + tph->server_protocol_properties_at_orb_level (protocol_properties); + if (this->set_socket_option (this->peer (), - tcp_properties_->send_buffer_size, - tcp_properties_->recv_buffer_size) == -1) + protocol_properties.send_buffer_size_, + protocol_properties.recv_buffer_size_) == -1) return -1; #if !defined (ACE_LACKS_TCP_NODELAY) + if (this->peer ().set_option (ACE_IPPROTO_TCP, TCP_NODELAY, - (void *) &this->tcp_properties_->no_delay, + (void *) &protocol_properties.no_delay_, sizeof (int)) == -1) return -1; #endif /* ! ACE_LACKS_TCP_NODELAY */ diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.h index 61b9b9eb86f..d27c9bec758 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.h +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.h @@ -61,8 +61,7 @@ namespace TAO * connection. */ Connection_Handler (TAO_ORB_Core *orb_core, - CORBA::Boolean flag, - void *arg); + CORBA::Boolean flag); /// Destructor. ~Connection_Handler (void); @@ -135,21 +134,6 @@ namespace TAO // **************************************************************** - class Connection_Handler_State - { - public: - - /// TCP configuration for the connection associated with the - /// connection handler. - TAO_IIOP_Properties *tcp_properties; - - /// Reference to the (downcast) SSLIOP::Current object. - TAO::SSLIOP::Current_var ssliop_current; - - }; - - // **************************************************************** - /** * @class State_Guard * diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp index d602407c5f7..4bb445347fd 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp @@ -1,7 +1,6 @@ #include "SSLIOP_Connector.h" #include "SSLIOP_OwnCredentials.h" #include "SSLIOP_Profile.h" -#include "SSLIOP_Util.h" #include "SSLIOP_X509.h" #include "orbsvcs/SecurityLevel2C.h" @@ -57,8 +56,7 @@ TAO::SSLIOP::Connector::Connector (::Security::QOP qop) : TAO::IIOP_SSL_Connector (), qop_ (qop), connect_strategy_ (), - base_connector_ (), - handler_state_ () + base_connector_ () { } @@ -76,11 +74,6 @@ TAO::SSLIOP::Connector::open (TAO_ORB_Core *orb_core) if (this->ACE_NESTED_CLASS (TAO, IIOP_SSL_Connector)::open (orb_core) == -1) return -1; - if (TAO::SSLIOP::Util::setup_handler_state (orb_core, - &(this->tcp_properties_), - this->handler_state_) != 0) - return -1; - // Our connect creation strategy CONNECT_CREATION_STRATEGY *connect_creation_strategy = 0; @@ -88,7 +81,6 @@ TAO::SSLIOP::Connector::open (TAO_ORB_Core *orb_core) CONNECT_CREATION_STRATEGY (orb_core->thr_mgr (), orb_core, - &(this->handler_state_), 0 /* Forcibly disable TAO's GIOPlite feature. It introduces a security hole. */), -1); @@ -332,17 +324,17 @@ TAO::SSLIOP::Connector::corbaloc_scan (const char *endpoint, if (this->TAO_IIOP_Connector::check_prefix (endpoint) != 0) return 0; } - + // Determine the (first in a list of possibly > 1) endpoint address const char *comma_pos = ACE_OS::strchr (endpoint,','); const char *slash_pos = ACE_OS::strchr (endpoint,'/'); - if (comma_pos == 0 && slash_pos == 0) + if (comma_pos == 0 && slash_pos == 0) { if (TAO_debug_level) { - ACE_DEBUG ((LM_DEBUG, + ACE_DEBUG ((LM_DEBUG, ACE_TEXT("(%P|%t) SSLIOP_Connector::corbaloc_scan warning: ") - ACE_TEXT("supplied string contains no comma or slash: %s\n"), + ACE_TEXT("supplied string contains no comma or slash: %s\n"), endpoint)); } len = ACE_OS::strlen (endpoint); @@ -356,14 +348,14 @@ TAO::SSLIOP::Connector::corbaloc_scan (const char *endpoint, { len = comma_pos - endpoint; } - + //Create the corresponding profile TAO_Profile *ptmp = 0; if (ssl_only) ptmp = this->make_secure_profile (ACE_ENV_SINGLE_ARG_PARAMETER); else ptmp = this->make_profile (ACE_ENV_SINGLE_ARG_PARAMETER); - + ACE_CHECK_RETURN (0); return ptmp; } @@ -374,22 +366,22 @@ TAO::SSLIOP::Connector::check_prefix (const char *endpoint) { // Check for a valid string if (!endpoint || !*endpoint) return -1; // Failure - + const char *protocol[] = { "ssliop", "sslioploc" }; - + size_t first_slot = ACE_OS::strchr (endpoint, ':') - endpoint; - + size_t len0 = ACE_OS::strlen (protocol[0]); size_t len1 = ACE_OS::strlen (protocol[1]); - + // Check for the proper prefix in the IOR. If the proper prefix // isn't in the IOR then it is not an IOR we can use. if (first_slot == len0 && ACE_OS::strncmp (endpoint, protocol[0], len0) == 0) return 0; - + if (first_slot == len1 && ACE_OS::strncmp (endpoint, protocol[1], len1) == 0) return 0; - + // Failure: not an SSLIOP IOR // DO NOT throw an exception here. return -1; @@ -829,7 +821,7 @@ TAO::SSLIOP::Connector::retrieve_credentials (TAO_Stub *stub, // Use the default certificate and private key, i.e. the one set // in the SSL_CTX that was used when creating the SSL data // structure. - + /** * @todo Check if the CredentialsCurator contains a default set * of SSLIOP OwnCredentials. diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.h index e49ab556126..dd4cfef6ec4 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.h +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.h @@ -92,7 +92,7 @@ namespace TAO virtual int cancel_svc_handler (TAO_Connection_Handler * svc_handler); //@} - /// SSL-specific profile + /// SSL-specific profile TAO_Profile * make_secure_profile (ACE_ENV_SINGLE_ARG_DECL); /// IIOP-specific connection establishment. @@ -148,10 +148,6 @@ namespace TAO /// The connector initiating connection requests for IIOP. BASE_CONNECTOR base_connector_; - /// State that will be passed to each SSLIOP connection handler upon - /// creation. - Connection_Handler_State handler_state_; - }; } // End SSLIOP namespace. diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Util.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Util.cpp index 2ae4d2713c8..33e82b9d32c 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Util.cpp +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Util.cpp @@ -13,11 +13,9 @@ ACE_RCSID (SSLIOP, #include "tao/debug.h" -int -TAO::SSLIOP::Util::setup_handler_state ( - TAO_ORB_Core *orb_core, - TAO_IIOP_Properties *tcp_properties, - TAO::SSLIOP::Connection_Handler_State &s) +TAO::SSLIOP::Current_ptr +TAO::SSLIOP::Util::current ( + TAO_ORB_Core *orb_core) { ACE_DECLARE_NEW_CORBA_ENV; ACE_TRY @@ -40,9 +38,7 @@ TAO::SSLIOP::Util::setup_handler_state ( if (CORBA::is_nil (tao_current.in ())) ACE_TRY_THROW (CORBA::INV_OBJREF ()); - - s.tcp_properties = tcp_properties; - s.ssliop_current = tao_current; + return tao_current._retn (); } ACE_CATCHANY { @@ -51,7 +47,7 @@ TAO::SSLIOP::Util::setup_handler_state ( "Could not resolve " "\"SSLIOPCurrent\" object"); - return -1; + return 0; } ACE_ENDTRY; ACE_CHECK_RETURN (-1); diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Util.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Util.h index 29b9ffe1496..efe5dc406b1 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Util.h +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Util.h @@ -24,6 +24,7 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +#include "SSLIOP_Current.h" class TAO_ORB_Core; class TAO_IIOP_Properties; @@ -32,8 +33,6 @@ namespace TAO { namespace SSLIOP { - class Connection_Handler_State; - /** * @class Util * @@ -47,12 +46,9 @@ namespace TAO { public: - /// Setup the state that will be passed to the connection handler - /// when the handler is constructed. - static int setup_handler_state ( - TAO_ORB_Core *orb_core, - TAO_IIOP_Properties *tcp_properties, - Connection_Handler_State &state); + /// Access Current. + static TAO::SSLIOP::Current_ptr current ( + TAO_ORB_Core *orb_core); }; diff --git a/TAO/tao/Connection_Handler.h b/TAO/tao/Connection_Handler.h index c85bd2e05ef..cf43218186d 100644 --- a/TAO/tao/Connection_Handler.h +++ b/TAO/tao/Connection_Handler.h @@ -101,8 +101,9 @@ public: /// Set the Diff-Serv codepoint on outgoing packets. Only has /// effect for remote protocols (e.g., IIOP); no effect for local - /// protocols (UIOP). - virtual int set_dscp_codepoint (CORBA::Boolean set_network_priority) = 0; + /// protocols (UIOP). Default implementation is for local + /// protocols. Remote protocols must overwrite implementation. + virtual int set_dscp_codepoint (CORBA::Boolean set_network_priority); protected: diff --git a/TAO/tao/Connection_Handler.inl b/TAO/tao/Connection_Handler.inl index 3562b10159a..d8cd7fafc4d 100644 --- a/TAO/tao/Connection_Handler.inl +++ b/TAO/tao/Connection_Handler.inl @@ -37,3 +37,9 @@ TAO_Connection_Handler::is_connecting (void) { return this->state_ == TAO_LF_Event::LFS_CONNECTION_WAIT; } + +ACE_INLINE int +TAO_Connection_Handler::set_dscp_codepoint (CORBA::Boolean) +{ + return 0; +} diff --git a/TAO/tao/Protocols_Hooks.h b/TAO/tao/Protocols_Hooks.h index 1818438e4b5..c8056809e19 100644 --- a/TAO/tao/Protocols_Hooks.h +++ b/TAO/tao/Protocols_Hooks.h @@ -42,10 +42,10 @@ class TAO_Connection_Handler; class TAO_Transport; class TAO_Stub; -class TAO_IIOP_Protocol_Properties +class TAO_Export TAO_IIOP_Protocol_Properties { -public: - +public: + TAO_IIOP_Protocol_Properties (void); CORBA::Long send_buffer_size_; @@ -55,21 +55,21 @@ public: CORBA::Boolean no_delay_; CORBA::Boolean enable_network_priority_; }; - -class TAO_UIOP_Protocol_Properties + +class TAO_Export TAO_UIOP_Protocol_Properties { -public: - +public: + TAO_UIOP_Protocol_Properties (void); CORBA::Long send_buffer_size_; CORBA::Long recv_buffer_size_; }; - -class TAO_SHMIOP_Protocol_Properties + +class TAO_Export TAO_SHMIOP_Protocol_Properties { -public: - +public: + TAO_SHMIOP_Protocol_Properties (void); CORBA::Long send_buffer_size_; @@ -81,20 +81,20 @@ public: ACE_CString mmap_filename_; ACE_CString mmap_lockname_; }; - -class TAO_DIOP_Protocol_Properties + +class TAO_Export TAO_DIOP_Protocol_Properties { -public: - +public: + TAO_DIOP_Protocol_Properties (void); CORBA::Boolean enable_network_priority_; }; - -class TAO_SCIOP_Protocol_Properties + +class TAO_Export TAO_SCIOP_Protocol_Properties { -public: - +public: + TAO_SCIOP_Protocol_Properties (void); CORBA::Long send_buffer_size_; @@ -104,7 +104,7 @@ public: CORBA::Boolean no_delay_; CORBA::Boolean enable_network_priority_; }; - + class TAO_Export TAO_Protocols_Hooks : public ACE_Service_Object { public: @@ -118,41 +118,41 @@ public: virtual CORBA::Boolean set_client_network_priority (IOP::ProfileId protocol_tag, TAO_Stub *stub ACE_ENV_ARG_DECL) = 0; - + virtual CORBA::Boolean set_server_network_priority (IOP::ProfileId protocol_tag, CORBA::Policy *policy ACE_ENV_ARG_DECL) = 0; - + virtual void server_protocol_properties_at_orb_level (TAO_IIOP_Protocol_Properties &protocol_properties ACE_ENV_ARG_DECL) = 0; - + virtual void client_protocol_properties_at_orb_level (TAO_IIOP_Protocol_Properties &protocol_properties ACE_ENV_ARG_DECL) = 0; - + virtual void server_protocol_properties_at_orb_level (TAO_UIOP_Protocol_Properties &protocol_properties ACE_ENV_ARG_DECL) = 0; - + virtual void client_protocol_properties_at_orb_level (TAO_UIOP_Protocol_Properties &protocol_properties ACE_ENV_ARG_DECL) = 0; - + virtual void server_protocol_properties_at_orb_level (TAO_SHMIOP_Protocol_Properties &protocol_properties ACE_ENV_ARG_DECL) = 0; - + virtual void client_protocol_properties_at_orb_level (TAO_SHMIOP_Protocol_Properties &protocol_properties ACE_ENV_ARG_DECL) = 0; - + virtual void server_protocol_properties_at_orb_level (TAO_DIOP_Protocol_Properties &protocol_properties ACE_ENV_ARG_DECL) = 0; - + virtual void client_protocol_properties_at_orb_level (TAO_DIOP_Protocol_Properties &protocol_properties ACE_ENV_ARG_DECL) = 0; - + virtual void server_protocol_properties_at_orb_level (TAO_SCIOP_Protocol_Properties &protocol_properties ACE_ENV_ARG_DECL) = 0; - + virtual void client_protocol_properties_at_orb_level (TAO_SCIOP_Protocol_Properties &protocol_properties ACE_ENV_ARG_DECL) = 0; - + virtual CORBA::Long get_dscp_codepoint (void) = 0; virtual void rt_service_context (TAO_Stub *stub, diff --git a/TAO/tao/Strategies/SHMIOP_Connection_Handler.cpp b/TAO/tao/Strategies/SHMIOP_Connection_Handler.cpp index 0b0d962a9b0..0cbda1e49ed 100644 --- a/TAO/tao/Strategies/SHMIOP_Connection_Handler.cpp +++ b/TAO/tao/Strategies/SHMIOP_Connection_Handler.cpp @@ -72,11 +72,11 @@ TAO_SHMIOP_Connection_Handler::open (void*) TAO_SHMIOP_Protocol_Properties protocol_properties; // Initialize values from ORB params. - protocol_properties.send_buffer_size_ = + protocol_properties.send_buffer_size_ = this->orb_core ()->orb_params ()->sock_sndbuf_size (); - protocol_properties.recv_buffer_size_ = + protocol_properties.recv_buffer_size_ = this->orb_core ()->orb_params ()->sock_rcvbuf_size (); - protocol_properties.no_delay_ = + protocol_properties.no_delay_ = this->orb_core ()->orb_params ()->nodelay (); TAO_Protocols_Hooks *tph = @@ -86,9 +86,9 @@ TAO_SHMIOP_Connection_Handler::open (void*) int client = 0; if (client) - tph->client_protocol_properties_at_orb_level (protocol_properties); + tph->client_protocol_properties_at_orb_level (protocol_properties); else - tph->server_protocol_properties_at_orb_level (protocol_properties); + tph->server_protocol_properties_at_orb_level (protocol_properties); if (this->set_socket_option (this->peer (), protocol_properties.send_buffer_size_, @@ -233,12 +233,6 @@ TAO_SHMIOP_Connection_Handler::add_transport_to_cache (void) this->transport ()); } -int -TAO_SHMIOP_Connection_Handler::set_dscp_codepoint (CORBA::Boolean) -{ - return 0; -} - // **************************************************************** #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) diff --git a/TAO/tao/Strategies/SHMIOP_Connection_Handler.h b/TAO/tao/Strategies/SHMIOP_Connection_Handler.h index 0439090b123..08b6c387626 100644 --- a/TAO/tao/Strategies/SHMIOP_Connection_Handler.h +++ b/TAO/tao/Strategies/SHMIOP_Connection_Handler.h @@ -50,7 +50,7 @@ public: /// Constructor. TAO_SHMIOP_Connection_Handler (ACE_Thread_Manager* t = 0); - /// Constructor. + /// Constructor. TAO_SHMIOP_Connection_Handler (TAO_ORB_Core *orb_core, CORBA::Boolean flag); @@ -87,9 +87,6 @@ public: /// Add ourselves to Cache. int add_transport_to_cache (void); - /// No-op since this is a local protocol. - int set_dscp_codepoint (CORBA::Boolean set_network_priority); - protected: //@{ diff --git a/TAO/tao/Strategies/UIOP_Connection_Handler.cpp b/TAO/tao/Strategies/UIOP_Connection_Handler.cpp index 4ffefd60d7a..005d68aa17e 100644 --- a/TAO/tao/Strategies/UIOP_Connection_Handler.cpp +++ b/TAO/tao/Strategies/UIOP_Connection_Handler.cpp @@ -74,9 +74,9 @@ TAO_UIOP_Connection_Handler::open (void*) TAO_UIOP_Protocol_Properties protocol_properties; // Initialize values from ORB params. - protocol_properties.send_buffer_size_ = + protocol_properties.send_buffer_size_ = this->orb_core ()->orb_params ()->sock_sndbuf_size (); - protocol_properties.recv_buffer_size_ = + protocol_properties.recv_buffer_size_ = this->orb_core ()->orb_params ()->sock_rcvbuf_size (); TAO_Protocols_Hooks *tph = @@ -86,9 +86,9 @@ TAO_UIOP_Connection_Handler::open (void*) int client = 0; if (client) - tph->client_protocol_properties_at_orb_level (protocol_properties); + tph->client_protocol_properties_at_orb_level (protocol_properties); else - tph->server_protocol_properties_at_orb_level (protocol_properties); + tph->server_protocol_properties_at_orb_level (protocol_properties); if (this->set_socket_option (this->peer (), protocol_properties.send_buffer_size_, @@ -211,12 +211,6 @@ TAO_UIOP_Connection_Handler::add_transport_to_cache (void) this->transport ()); } -int -TAO_UIOP_Connection_Handler::set_dscp_codepoint (CORBA::Boolean) -{ - return 0; -} - #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) template class ACE_Svc_Handler<ACE_LSOCK_STREAM, ACE_NULL_SYNCH>; diff --git a/TAO/tao/Strategies/UIOP_Connection_Handler.h b/TAO/tao/Strategies/UIOP_Connection_Handler.h index 09598d6db1d..021a13ca345 100644 --- a/TAO/tao/Strategies/UIOP_Connection_Handler.h +++ b/TAO/tao/Strategies/UIOP_Connection_Handler.h @@ -55,7 +55,7 @@ public: TAO_UIOP_Connection_Handler (ACE_Thread_Manager* t = 0); - /// Constructor. + /// Constructor. TAO_UIOP_Connection_Handler (TAO_ORB_Core *orb_core, CORBA::Boolean flag); @@ -90,9 +90,6 @@ public: /// Add ourselves to Cache. int add_transport_to_cache (void); - /// No-op since this is a local protocol. - int set_dscp_codepoint (CORBA::Boolean set_network_priority); - protected: //@{ |