summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-01-31 22:32:28 +0000
committerjai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-01-31 22:32:28 +0000
commit78abb0b0452283d7a7e3700e9c9ffe52912f0d5e (patch)
tree8aaf5f208e979e34b55ca443c493914cd17e79c9
parent03581c63ccf22164290f59259f20cc46afb6f020 (diff)
downloadATCD-78abb0b0452283d7a7e3700e9c9ffe52912f0d5e.tar.gz
adding DS library
-rw-r--r--modules/TAO/tao/DiffServPolicy/DiffServ_Protocols_Hooks.cpp34
1 files changed, 24 insertions, 10 deletions
diff --git a/modules/TAO/tao/DiffServPolicy/DiffServ_Protocols_Hooks.cpp b/modules/TAO/tao/DiffServPolicy/DiffServ_Protocols_Hooks.cpp
index 26c4cb1778f..02c4fa81aaf 100644
--- a/modules/TAO/tao/DiffServPolicy/DiffServ_Protocols_Hooks.cpp
+++ b/modules/TAO/tao/DiffServPolicy/DiffServ_Protocols_Hooks.cpp
@@ -1,5 +1,6 @@
#include "tao/DiffServPolicy/DiffServ_Protocols_Hooks.h"
#include "tao/Stub.h"
+#include "tao/Profile.h"
#include "tao/ORB_Core.h"
#include "tao/Service_Context.h"
#include "tao/CDR.h"
@@ -87,26 +88,36 @@ const CORBA::Long
TAO_DS_Network_Priority_Protocols_Hooks::get_dscp_codepoint (
TAO_Stub *stub, CORBA::Object *object)
{
+ CORBA::Long dscp = 0;
+ TAO::DiffservCodepoint diffserv_codepoint;
+
CORBA::Policy_var client_nw_priority_policy =
stub->get_cached_policy (
TAO_CACHED_POLICY_CLIENT_NETWORK_PRIORITY
ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
- CORBA::Policy_var server_nw_priority_policy =
- object->_get_cached_policy (
- TAO_CACHED_POLICY_NETWORK_PRIORITY
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
-
- CORBA::Long dscp = 0;
- TAO::DiffservCodepoint diffserv_codepoint;
-
if (CORBA::is_nil (client_nw_priority_policy.in ()))
{
+ TAO_Stub *server_stub = object->_stubobj ();
+ TAO_MProfile server_profiles = server_stub->base_profiles ();
+ CORBA::PolicyList_var policy_list =
+ server_profiles.policy_list ();
+
+ CORBA::ULong length = policy_list->length ();
+
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ if (policy_list[i]->policy_type () == TAO::NETWORK_PRIORITY_TYPE)
+ {
+ CORBA::Policy_var server_nw_priority_policy =
+ CORBA::Policy::_duplicate (policy_list[i]);
+ }
+ }
+
if (CORBA::is_nil (server_nw_priority_policy.in ()))
{
- // cannot happen
+ return dscp;
}
else
{
@@ -130,6 +141,7 @@ TAO_DS_Network_Priority_Protocols_Hooks::get_dscp_codepoint (
ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
dscp = diffserv_codepoint;
+ return dscp;
}
}
}
@@ -146,8 +158,10 @@ TAO_DS_Network_Priority_Protocols_Hooks::get_dscp_codepoint (
diffserv_codepoint =
client_nw_priority->request_diffserv_codepoint ();
dscp = diffserv_codepoint;
+ return dscp;
}
}
+
return dscp;
}