summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOssama Othman <ossama-othman@users.noreply.github.com>2001-05-12 19:44:31 +0000
committerOssama Othman <ossama-othman@users.noreply.github.com>2001-05-12 19:44:31 +0000
commit2d897af57a3d6b45127fa263a2d3994b0c284562 (patch)
treef83f21413cfb02e9ba16b1aea371596fa2030835
parent7659bc547c81a11074b1f3ea885debe05210e8e9 (diff)
downloadATCD-2d897af57a3d6b45127fa263a2d3994b0c284562.tar.gz
ChangeLogTag:Sat May 12 12:39:47 2001 Ossama Othman <ossama@uci.edu>
-rw-r--r--TAO/ChangeLogs/ChangeLog-02a19
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/ImplRepo_i.cpp8
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/README.txt74
-rw-r--r--TAO/orbsvcs/ImplRepo_Service/tao_imr_i.cpp9
-rw-r--r--TAO/tao/PortableServer/POA.cpp51
5 files changed, 108 insertions, 53 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a
index 96fea8828f9..f73bde40234 100644
--- a/TAO/ChangeLogs/ChangeLog-02a
+++ b/TAO/ChangeLogs/ChangeLog-02a
@@ -1,3 +1,22 @@
+Sat May 12 12:39:47 2001 Ossama Othman <ossama@uci.edu>
+
+ * tao/PortableServer/POA.cpp (imr_notify_startup, key_to_object):
+ * orbsvcs/ImplRepo_Service/ImplRepo_i.cpp (server_is_running):
+ * orbsvcs/ImplRepo_Service/tao_imr_i.cpp (run):
+
+ The Implementation Repository code used stringified URL style
+ IORs to determine which port a given server was running on. It
+ expected them to be of the form "iioploc://". However, TAO no
+ longer generates IORs of that form. Instead it generates URL
+ style IORs of the form defined in the latest Interoperable
+ Naming Service spec, i.e. "corbaloc:iiop:...". Updated the
+ above functions to parse "corbaloc" IORs instead. This fixes a
+ segmentation fault occured when "ImR-ifying" IORs. [Bug 909]
+
+ * orbsvcs/ImplRepo_Service/README.txt:
+
+ Corrected malformed "corbaloc" URL IORs in this file.
+
Sat May 12 08:30:17 2001 Balachandran Natarajan <bala@cs.wustl.edu>
* tao/Services_Activate.h: Fixed a compile error in platforms with
diff --git a/TAO/orbsvcs/ImplRepo_Service/ImplRepo_i.cpp b/TAO/orbsvcs/ImplRepo_Service/ImplRepo_i.cpp
index 6f622d99735..4827c68a804 100644
--- a/TAO/orbsvcs/ImplRepo_Service/ImplRepo_i.cpp
+++ b/TAO/orbsvcs/ImplRepo_Service/ImplRepo_i.cpp
@@ -707,9 +707,13 @@ ImplRepo_i::server_is_running (const char *server,
return new_location;
- char *pos = ACE_OS::strstr (new_location, "://");
+ // Search for "corbaloc:" alone, without the protocol. This code
+ // should be protocol neutral.
+ const char corbaloc[] = "corbaloc:";
+ char *pos = ACE_OS::strstr (new_location, corbaloc);
+ pos = ACE_OS::strchr (pos + sizeof (corbaloc), ':');
- pos = ACE_OS::strchr (pos + 3, profile->object_key_delimiter ());
+ pos = ACE_OS::strchr (pos + 1, profile->object_key_delimiter ());
if (pos)
*(pos + 1) = 0; // Crop the string
diff --git a/TAO/orbsvcs/ImplRepo_Service/README.txt b/TAO/orbsvcs/ImplRepo_Service/README.txt
index 684a2ccf9a2..81eabd574c4 100644
--- a/TAO/orbsvcs/ImplRepo_Service/README.txt
+++ b/TAO/orbsvcs/ImplRepo_Service/README.txt
@@ -156,12 +156,13 @@ to start the Name Service).
Now we should be able to run some client that uses the Name Service like this:
-<code>client -ORBDefaultInitRef corbaloc://doriath:5555/</code>
+<code>client -ORBDefaultInitRef corbaloc:iiop:doriath:5555/</code>
When the client calls resolve_initial_reference("NameService"), the ORB will
-resolve that to "corbaloc://doriath:5555/NameService". The ImR recognizes this
-IOR as a pointer to the NameService, and will then start it up if necessary.
-Finally, it will forward the client to the Name Service.
+resolve that to "corbaloc:iiop:doriath:5555/NameService". The ImR
+recognizes this IOR as a pointer to the NameService, and will then
+start it up if necessary. Finally, it will forward the client to the
+Name Service.
Services used in this way have two requirements:
@@ -169,29 +170,31 @@ Services used in this way have two requirements:
example, the Name Service is registered as the "NameService", and thus also
contains a POA with the name "NameService".
- The server must also be able to handle the INS name
- "corbaloc://machine:port/poa_name", where the poa_name is the same name as
- above.
+ "corbaloc:iiop:machine:port/poa_name", where the poa_name is the
+ same name as above.
@subsection activationmodes What are activation modes
Each server can have one of three different types of activation modes:
<ul>
- <li>NORMAL is the default. The server can be started via tao_ImR, the command
- line, and with client requests.
- <li>MANUAL specifies that the server shouldn't be activated with a client request
- but can be activated through tao_ImR or via the command line.
- <li>PER_CLIENT specifies that each request to the ImplRepo will result in a new
- server process started up. Because clients cache the forwarded reference,
- there is one server per client (more or less). There are some exceptions,
- such as if the original IOR is used in different threads (each thread would
- get a different server). <b>Note:</b> The Implementation Repository doesn't
- store any information about the started servers in this mode, so it cannot be
- used to shut down the servers. So the servers must have an alternative way of
- shutting down.
- <li>AUTO_START specifies that a server should be activated when the Implementation
- Repository is started. tao_ImR also has an autostart command to activate all
- servers marked AUTO_START
+ <li>NORMAL is the default. The server can be started via tao_ImR,
+ the command line, and with client requests.
+ <li>MANUAL specifies that the server shouldn't be activated with a
+ client request but can be activated through tao_ImR or via the
+ command line.
+ <li>PER_CLIENT specifies that each request to the ImplRepo will
+ result in a new server process started up. Because clients
+ cache the forwarded reference, there is one server per client
+ (more or less). There are some exceptions, such as if the
+ original IOR is used in different threads (each thread would get
+ a different server). <b>Note:</b> The Implementation Repository
+ doesn't store any information about the started servers in this
+ mode, so it cannot be used to shut down the servers. So the
+ servers must have an alternative way of shutting down.
+ <li>AUTO_START specifies that a server should be activated when the
+ Implementation Repository is started. tao_ImR also has an
+ autostart command to activate all servers marked AUTO_START.
</ul>
@subsection taoImRior Using the tao_ImR ior command
@@ -222,9 +225,11 @@ Service is intended to be used in situations where an IOR could be created by
hand. Using the same information as above, it is not difficult to take the
endpoint information from the ImR and attach the POA name. For example,
let's say that we are running the ImR on ringil.ece.uci.edu at port 5000.
-The endpoint would be &quot;iioploc://1.1@ringil.ece.uci.edu:5000&quot;. If
-we are creating an IOR for the nestea server, we'd just need to attach
-&quot;/nestea_server&quot; to the end of the endpoint. Now we have an IOR.
+The endpoint would be
+&quot;corbaloc:iiop:1.2@ringil.ece.uci.edu:5000&quot;. If we are
+creating an IOR for the nestea server, we'd just need to attach
+&quot;/nestea_server&quot; to the end of the endpoint. Now we have an
+IOR.
So what does this mean for the server?
@@ -260,8 +265,8 @@ Just one more thing, each object that needs an IOR needs to be registered
with the IOR table. But this raises the problem of uniqueness; they all
can't have the same name. The ImR will actually only look at the name part
of the simplified IOR up to the first &quot;/&quot;. So both
-&quot;iioploc://1.1@ringil:5000/nestea_server/foo&quot; and
-&quot;iioploc://1.1@ringil:5000/nestea_server/bar&quot; will be treated by
+&quot;corbaloc:iiop:1.2@ringil:5000/nestea_server/foo&quot; and
+&quot;corbaloc:iiop:1.2@ringil:5000/nestea_server/bar&quot; will be treated by
the ImR as objects in the &quot;nestea_server&quot; server.
@subsection persistence Persistent Implementation Repository
@@ -286,19 +291,20 @@ or in a Perl script by adding<br>
use Sys::Hostname;<br>
$hostname = hostname();<br>
-There are even specific port numbers, assigned to the OMG by the IONA, which can be
-used for this purpose. They are 683 (for IIOP) and 684 (for IIOP SSL). For more
-information about this, see <a href="http://www.iana.org/">http://www.iana.org/</a>
+There are even specific port numbers, assigned to the OMG by the IANA,
+which can be used for this purpose. They are 683 (for IIOP) and 684
+(for IIOP over SSL). For more information about this, see
+<a href="http://www.iana.org/">http://www.iana.org/</a>
and <a href="http://www.isi.edu/in-notes/iana/assignments/port-numbers">
http://www.isi.edu/in-notes/iana/assignments/port-numbers</a>.<br><br>
<li>
-Pass the ImR a filename to use for the backing store, specified by the command line
-option<br>
+Pass the ImR a filename to use for the backing store, specified by the
+command line option<br>
-p (filename)<br>
-This option must be used the first and every subsequent time the persistent ImR is
-started up.
+This option must be used the first and every subsequent time the
+persistent ImR is started up.
</ul>
*/
@@ -378,7 +384,7 @@ The Naming Service in TAO contains one persistant POA named "NameService".
If -ORBUseIMR 1 is passed to it, it will communicate with the ImR as any
other persistent POA does. Also, the Naming Service recognizes the INS
object key "NameService". This allows you to use the "tao_imr ior"
-command to create corbaloc IORS
+command to create corbaloc IORs.
NameService was chosen because resolve_initial_references () uses that
name. And that allows us to do interesting things with ORBDefaultInitRef
diff --git a/TAO/orbsvcs/ImplRepo_Service/tao_imr_i.cpp b/TAO/orbsvcs/ImplRepo_Service/tao_imr_i.cpp
index 68d03597d0b..f0da66257b5 100644
--- a/TAO/orbsvcs/ImplRepo_Service/tao_imr_i.cpp
+++ b/TAO/orbsvcs/ImplRepo_Service/tao_imr_i.cpp
@@ -761,8 +761,10 @@ TAO_IMR_Op_IOR::run (void)
this->implrepo_->_stubobj ()->profile_in_use ()->to_string (ACE_TRY_ENV);
ACE_TRY_CHECK;
- char *pos = ACE_OS::strstr (imr_str.inout (),
- "://");
+ // Search for "corbaloc:" alone, without the protocol. This code
+ // should be protocol neutral.
+ const char corbaloc[] = "corbaloc:";
+ char *pos = ACE_OS::strstr (imr_str.inout (), corbaloc);
if (pos == 0)
ACE_ERROR_RETURN ((LM_ERROR,
@@ -770,7 +772,8 @@ TAO_IMR_Op_IOR::run (void)
-1);
else
{
- pos = ACE_OS::strchr (pos + 3,
+ pos = ACE_OS::strchr (pos + sizeof (corbaloc), ':');
+ pos = ACE_OS::strchr (pos + 1,
this->implrepo_->_stubobj ()->profile_in_use ()->object_key_delimiter ());
if (pos)
diff --git a/TAO/tao/PortableServer/POA.cpp b/TAO/tao/PortableServer/POA.cpp
index fad35c1640a..65575edb4cf 100644
--- a/TAO/tao/PortableServer/POA.cpp
+++ b/TAO/tao/PortableServer/POA.cpp
@@ -3932,19 +3932,32 @@ TAO_POA_Policies::priority_bands (TAO_PriorityBandedConnectionPolicy *policy)
void
TAO_POA_Policies::server_protocol (TAO_ServerProtocolPolicy *policy)
{
- if (this->server_protocol_)
+ ACE_TRY_NEW_ENV
{
- this->server_protocol_->destroy ();
- CORBA::release (this->server_protocol_);
- this->server_protocol_ = 0;
- }
+ if (this->server_protocol_)
+ {
+ this->server_protocol_->destroy (ACE_TRY_ENV);
+ ACE_TRY_CHECK;
- if (policy)
+ CORBA::release (this->server_protocol_);
+ this->server_protocol_ = 0;
+ }
+
+ if (policy)
+ {
+ ACE_NEW_THROW_EX (this->server_protocol_,
+ TAO_ServerProtocolPolicy (*policy),
+ CORBA::NO_MEMORY ());
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
{
- ACE_NEW (this->server_protocol_,
- TAO_ServerProtocolPolicy (*policy));
+ if (TAO_debug_level > 4)
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "TAO_POA_Policies::server_protocol");
}
-
+ ACE_ENDTRY;
}
#endif /* TAO_HAS_RT_CORBA == 1 */
@@ -4039,10 +4052,16 @@ TAO_POA::key_to_object (const TAO_ObjectKey &key,
ACE_DEBUG ((LM_DEBUG,
"IMR IOR = \n%s\n",
imr_str.in ()));
- char *pos = ACE_OS::strstr (imr_str.inout (),
- "://");
- pos = ACE_OS::strchr (pos + 3,
+
+ // Search for "corbaloc:" alone, without the protocol. This code
+ // should be protocol neutral.
+ const char corbaloc[] = "corbaloc:";
+ char *pos = ACE_OS::strstr (imr_str.inout (), corbaloc);
+ pos = ACE_OS::strchr (pos + sizeof (corbaloc), ':');
+
+ pos = ACE_OS::strchr (pos + 1,
imr->_stubobj ()->profile_in_use ()->object_key_delimiter ());
+
if (pos)
pos[1] = 0; // Crop the string.
else
@@ -4318,9 +4337,13 @@ TAO_POA::imr_notify_startup (CORBA_Environment &ACE_TRY_ENV)
svr->_stubobj ()->profile_in_use ()->to_string (ACE_TRY_ENV);
ACE_CHECK;
- char *pos = ACE_OS::strstr (svr_str.inout (), "://");
+ // Search for "corbaloc:" alone, without the protocol. This code
+ // should be protocol neutral.
+ const char corbaloc[] = "corbaloc:";
+ char *pos = ACE_OS::strstr (svr_str.inout (), corbaloc);
+ pos = ACE_OS::strchr (pos + sizeof (corbaloc), ':');
- pos = ACE_OS::strchr (pos + 3,
+ pos = ACE_OS::strchr (pos + 1,
svr->_stubobj ()->profile_in_use ()->object_key_delimiter ());
if (pos)