diff options
author | Ossama Othman <ossama-othman@users.noreply.github.com> | 1999-05-24 22:18:27 +0000 |
---|---|---|
committer | Ossama Othman <ossama-othman@users.noreply.github.com> | 1999-05-24 22:18:27 +0000 |
commit | 255d9756e659f7967aa99650701169e00a39fd16 (patch) | |
tree | b5f1b6012f76e40cfa17cb696bfcec6586bf6bf1 | |
parent | e78d2fb29246a7feb36b6de03dbaa9fedc441991 (diff) | |
download | ATCD-255d9756e659f7967aa99650701169e00a39fd16.tar.gz |
fixed multiple calls to TAO_Acceptor_Registry::open().
endpoint parser fixes/updates
-rw-r--r-- | TAO/tao/ORB_Core.cpp | 46 | ||||
-rw-r--r-- | TAO/tao/Pluggable.i | 1 | ||||
-rw-r--r-- | TAO/tao/Stub.i | 1 | ||||
-rw-r--r-- | TAO/tao/UIOP_Connect.cpp | 6 | ||||
-rw-r--r-- | TAO/tao/UIOP_Connect.h | 3 | ||||
-rw-r--r-- | TAO/tao/UIOP_Profile.cpp | 2 | ||||
-rw-r--r-- | TAO/tao/params.cpp | 24 |
7 files changed, 60 insertions, 23 deletions
diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp index 9133d479ec1..e4bf5958d30 100644 --- a/TAO/tao/ORB_Core.cpp +++ b/TAO/tao/ORB_Core.cpp @@ -239,6 +239,7 @@ TAO_ORB_Core::init (int &argc, char *argv[]) arg_shifter.consume_arg (); } } + else if (ACE_OS::strcmp (current_arg, "-ORBendpoint") == 0) { // Each "endpoint" is of the form: @@ -265,10 +266,19 @@ TAO_ORB_Core::init (int &argc, char *argv[]) { ACE_CString endpts (arg_shifter.get_current ()); - this->orb_params ()->endpoints (endpts); + if (this->orb_params ()->endpoints (endpts) != 0) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%P|%t)\n" + "Invalid endpoint(s) specified:\n%s\n", + endpts.c_str ()), + -1); + } + arg_shifter.consume_arg (); } } + else if (ACE_OS::strcmp (current_arg, "-ORBhost") == 0) { // @@ Fred&Carlos: This option now has the same effect as specifying @@ -287,7 +297,7 @@ TAO_ORB_Core::init (int &argc, char *argv[]) // may be dropped in future releases. ACE_DEBUG ((LM_WARNING, - "(%P|%t) WARNING: The `-ORBhost' option is obsolete.\n" + "(%P|%t) \nWARNING: The `-ORBhost' option is obsolete.\n" "In the future, use the `-ORBendpoint' option.\n")); if (arg_shifter.is_parameter_next()) @@ -348,7 +358,7 @@ TAO_ORB_Core::init (int &argc, char *argv[]) old_style_endpoint = 1; ACE_DEBUG ((LM_WARNING, - "(%P|%t) WARNING: The `-ORBport' option is obsolete.\n" + "(%P|%t) \nWARNING: The `-ORBport' option is obsolete.\n" "In the future, use the `-ORBendpoint' option.\n")); // Specify the port number/name on which we should listen @@ -481,33 +491,33 @@ TAO_ORB_Core::init (int &argc, char *argv[]) if (arg_shifter.is_parameter_next ()) { - const char *preconnections = arg_shifter.get_current (); - - arg_shifter.consume_arg (); + ACE_CString preconnections (arg_shifter.get_current ()); - ACE_CString p; - - if (ACE_OS::strstr (preconnections, "://") == 0) + if (this->orb_params ()->endpoints (preconnections) != 0) { - // Handle old style preconnects for backward compatibility + // Handle old style preconnects for backward compatibility. + // The old style preconnects only work for IIOP! // Issue a warning since this backward compatibilty support // may be dropped in future releases. ACE_DEBUG ((LM_WARNING, - "(%P|%t) WARNING: The `host:port' pair style " + "(%P|%t) \nWARNING: The `host:port' pair style " "for `-ORBpreconnect' is obsolete.\n" "In the future, use the URL style.\n")); - p = + preconnections = ACE_CString ("iiop://") + ACE_CString (preconnections) + ACE_CString ("/"); - } - else - p = ACE_CString (preconnections); - this->orb_params ()->endpoints (p); + ACE_DEBUG ((LM_WARNING, + "(%P|%t) \nWARNING: The following preconnection " + "will be used:\n%s\n", + preconnections.c_str())); + + this->orb_params ()->endpoints (preconnections); + } } } @@ -734,8 +744,8 @@ TAO_ORB_Core::init (int &argc, char *argv[]) // Init acceptor_registry_ this->acceptor_registry (trf->get_acceptor_registry ()); - if (this->acceptor_registry ()->open (this) == -1) - return -1; + // if (this->acceptor_registry ()->open (this) == -1) + // return -1; // Have registry parse the preconnects if (this->orb_params ()->preconnects ().is_empty () == 0) diff --git a/TAO/tao/Pluggable.i b/TAO/tao/Pluggable.i index 24afa65b009..40d39d78c45 100644 --- a/TAO/tao/Pluggable.i +++ b/TAO/tao/Pluggable.i @@ -1,3 +1,4 @@ +// -*- C++ -*- // $Id$ ACE_INLINE diff --git a/TAO/tao/Stub.i b/TAO/tao/Stub.i index 11c5c6ac89a..d5abbbf7c8e 100644 --- a/TAO/tao/Stub.i +++ b/TAO/tao/Stub.i @@ -1,3 +1,4 @@ +// -*- C++ -*- // $Id$ // @@ Get rid of profile specific stuff, it is now in it's own class and diff --git a/TAO/tao/UIOP_Connect.cpp b/TAO/tao/UIOP_Connect.cpp index 5830649b605..53e86f80cc1 100644 --- a/TAO/tao/UIOP_Connect.cpp +++ b/TAO/tao/UIOP_Connect.cpp @@ -53,6 +53,12 @@ TAO_UIOP_Server_Connection_Handler::TAO_UIOP_Server_Connection_Handler (TAO_ORB_ uiop_transport_ = new TAO_UIOP_Server_Transport (this); } +TAO_UIOP_Server_Connection_Handler::~TAO_UIOP_Server_Connection_Handler (void) +{ + delete uiop_transport_; + uiop_transport_ = 0; +} + TAO_Transport * TAO_UIOP_Server_Connection_Handler::transport (void) { diff --git a/TAO/tao/UIOP_Connect.h b/TAO/tao/UIOP_Connect.h index 315f11508b3..69f16d31443 100644 --- a/TAO/tao/UIOP_Connect.h +++ b/TAO/tao/UIOP_Connect.h @@ -216,6 +216,9 @@ public: TAO_UIOP_Server_Connection_Handler (TAO_ORB_Core *orb_core); // Constructor. + ~TAO_UIOP_Server_Connection_Handler (void); + // Destructor + virtual int open (void *); // Called by the <Strategy_Acceptor> when the handler is completely // connected. Argument is unused. diff --git a/TAO/tao/UIOP_Profile.cpp b/TAO/tao/UIOP_Profile.cpp index 938a2eead46..514ded54aae 100644 --- a/TAO/tao/UIOP_Profile.cpp +++ b/TAO/tao/UIOP_Profile.cpp @@ -597,7 +597,7 @@ TAO_UIOP_Profile::to_string (CORBA::Environment &env) this->object_key ()); u_int buflen = (ACE_OS::strlen (::prefix_) + - 2 /* major # */ + 2 /* minor # */ + 1 /* DOT */ + + 2 /* major # */ + 2 /* minor # */ + 1 /* decimal point */ + 2 /* double-slash separator */ + ACE_OS::strlen (this->rendezvous_point_) + 1 /* slash separator */ + diff --git a/TAO/tao/params.cpp b/TAO/tao/params.cpp index b4406777aa8..8059173c75e 100644 --- a/TAO/tao/params.cpp +++ b/TAO/tao/params.cpp @@ -38,6 +38,9 @@ TAO_ORB_Parameters::parse_endpoints (ACE_CString &endpoints, // // A single endpoint, instead of several, can be added just as well. + int status = 0; + // Return code: 0 = success, 1 = failure + const char endpoints_delimiter = ';'; int length = endpoints.length (); @@ -77,22 +80,35 @@ TAO_ORB_Parameters::parse_endpoints (ACE_CString &endpoints, continue; } - endpoints_list.insert (endpoints.substring (begin, end)); + ACE_CString endpt = endpoints.substring (begin, end); // The substring call will work even if `end' is equal to // ACE_CString::npos since that will just extract the substring // from the offset `begin' to the end of the string. + // Check for a valid URL style endpoint set + int check_offset = endpt.find (':'); + + if (check_offset > 0 && + check_offset != endpt.npos && + endpt.find ("//", check_offset + 1) != endpt.npos) + { + endpoints_list.insert (endpt); + // Insert endpoint into list + } + else + status = -1; // Error: invalid URL style endpoint set + begin += end + 1; end = endpoints.find (endpoints_delimiter, begin); } - - return 0; // Success } else { - return -1; + status = -1; // Failure: Empty string } + + return status; } |