summaryrefslogtreecommitdiff
path: root/TAO/tao/ZIOP
diff options
context:
space:
mode:
authorsma <sma@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2012-06-11 12:45:05 +0000
committersma <sma@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2012-06-11 12:45:05 +0000
commit15a0be0bd2af961aad172ddc61a7af30552abec0 (patch)
treebb12883bd3fb08ae5738b8bffc3e1fb9c4fd35d2 /TAO/tao/ZIOP
parent691966a7cc39034dcfa1975e73c2ac57301143a5 (diff)
downloadATCD-15a0be0bd2af961aad172ddc61a7af30552abec0.tar.gz
Mon Jun 11 12:45:00 UTC 2012 Simon Massey <simon dot massey at prismtech dot com>
Add the -ORBAllowZIOPNoServerPolicies <0|1> option to the ORB, test and check for use case.
Diffstat (limited to 'TAO/tao/ZIOP')
-rw-r--r--TAO/tao/ZIOP/ZIOP_Stub.cpp55
1 files changed, 37 insertions, 18 deletions
diff --git a/TAO/tao/ZIOP/ZIOP_Stub.cpp b/TAO/tao/ZIOP/ZIOP_Stub.cpp
index 4380d032df0..7224fcda2e5 100644
--- a/TAO/tao/ZIOP/ZIOP_Stub.cpp
+++ b/TAO/tao/ZIOP/ZIOP_Stub.cpp
@@ -176,45 +176,64 @@ TAO_ZIOP_Stub::effective_compression_enabling_policy (void)
CORBA::Policy *
TAO_ZIOP_Stub::effective_compression_id_list_policy (void)
{
- // Get the value from the IOR (This is the SERVERS available compressor's list).
+ // Get effective override (This is the CLIENTS compressor's priority ordered list).
CORBA::Policy_var policy (
- this->exposed_compression_id_list_policy ());
- ZIOP::CompressorIdLevelListPolicy_var serverCompressors (
+ this->TAO_Stub::get_cached_policy (TAO_CACHED_COMPRESSION_ID_LEVEL_LIST_POLICY));
+ ZIOP::CompressorIdLevelListPolicy_var clientCompressors (
ZIOP::CompressorIdLevelListPolicy::_narrow (policy.in ()));
- // If SERVER does not have an available compressor's list, compression can't go ahead.
- if (CORBA::is_nil (serverCompressors.in ()))
+ // If CLIENT does not have an available compressor's list, compression can't go ahead.
+ if (CORBA::is_nil (clientCompressors.in ()))
{
if (6 < TAO_debug_level)
{
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("ZIOP (%P|%t) ")
ACE_TEXT ("TAO_ZIOP_Stub::effective_compression_id_list_policy, ")
- ACE_TEXT ("no serverCompressorIdLevelListPolicy (did not compress).\n")));
+ ACE_TEXT ("no clientCompressorIdLevelListPolicy (did not compress).\n")));
}
return 0;
}
- ::Compression::CompressorIdLevelList &serverList =
- *serverCompressors->compressor_ids ();
+ ::Compression::CompressorIdLevelList &clientList =
+ *clientCompressors->compressor_ids ();
- // Get effective override (This is the CLIENTS compressor's priority ordered list).
- policy =
- this->TAO_Stub::get_cached_policy (TAO_CACHED_COMPRESSION_ID_LEVEL_LIST_POLICY);
- ZIOP::CompressorIdLevelListPolicy_var clientCompressors (
+ // Get the value from the IOR (This is the SERVERS available compressor's list).
+ policy = this->exposed_compression_id_list_policy ();
+ ZIOP::CompressorIdLevelListPolicy_var serverCompressors (
ZIOP::CompressorIdLevelListPolicy::_narrow (policy.in ()));
- // Likewise if CLIENT does not have a compressor's list, compression can't go ahead.
- if (CORBA::is_nil (clientCompressors.in ()))
+ // Likewise if SERVER does not have an available compressor's list, compression can't go ahead.
+ if (CORBA::is_nil (serverCompressors.in ()))
{
- if (6 < TAO_debug_level)
+ // OK if we are allowing the client to ZIOP compress without having any server
+ // ZIOP available compressor's list policies, then we simply return the copy of
+ // the client's compressors here and we will go on to use the first compressor
+ // configured. THIS IS GOING DIRECTLY AGAINST THE CORBA Compressed GIOP (ZIOP)
+ // V1.0 specification, but allows us to use ZIOP with MIOP and/or CORBALOCs.
+ // We have to trust the end user knows what his system is configured to allow;
+ // Any servers that cannot decompress the client's used ZIOP compressor will
+ // reject the request as they simply cannot decode or handle it (comms will
+ // simply timeout or lock-up at the client for any such incorrect two-way requests).
+ if (this->orb_core()->orb_params()->allow_ziop_no_server_policies ())
+ {
+ if (6 < TAO_debug_level)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ZIOP (%P|%t) ")
+ ACE_TEXT ("TAO_ZIOP_Stub::effective_compression_id_list_policy, ")
+ ACE_TEXT ("no serverCompressorIdLevelListPolicy (but allow_ziop_no_server_policies in force).\n")));
+ }
+ return clientCompressors._retn ();
+ }
+ else if (6 < TAO_debug_level)
{
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("ZIOP (%P|%t) ")
ACE_TEXT ("TAO_ZIOP_Stub::effective_compression_id_list_policy, ")
- ACE_TEXT ("no clientCompressorIdLevelListPolicy (did not compress).\n")));
+ ACE_TEXT ("no serverCompressorIdLevelListPolicy (did not compress).\n")));
}
return 0;
}
- ::Compression::CompressorIdLevelList &clientList =
- *clientCompressors->compressor_ids ();
+ ::Compression::CompressorIdLevelList &serverList =
+ *serverCompressors->compressor_ids ();
// For each CLIENT compressor (in priority order) check...
for (CORBA::ULong client = 0u; client < clientList.length (); ++client)