summaryrefslogtreecommitdiff
path: root/TAO/DevGuideExamples/PortableInterceptors/PICurrent/ClientInterceptor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/DevGuideExamples/PortableInterceptors/PICurrent/ClientInterceptor.cpp')
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/PICurrent/ClientInterceptor.cpp33
1 files changed, 18 insertions, 15 deletions
diff --git a/TAO/DevGuideExamples/PortableInterceptors/PICurrent/ClientInterceptor.cpp b/TAO/DevGuideExamples/PortableInterceptors/PICurrent/ClientInterceptor.cpp
index 538ec6d1bdf..9b8850a173c 100644
--- a/TAO/DevGuideExamples/PortableInterceptors/PICurrent/ClientInterceptor.cpp
+++ b/TAO/DevGuideExamples/PortableInterceptors/PICurrent/ClientInterceptor.cpp
@@ -61,29 +61,32 @@ ClientInterceptor::send_request (PortableInterceptor::ClientRequestInfo_ptr ri)
ACE_OS::strcpy (reinterpret_cast<char*> (buf), user_name);
- sc.context_data.replace (string_len, string_len, buf, 1);
+ sc.context_data.replace (string_len, string_len, buf, true);
// recursive call setup
CORBA::Any *recurse = ri->get_slot(slot);
CORBA::Boolean x;
- *recurse >>= CORBA::Any::to_boolean(x);
-
CORBA::Any flag;
- if (x == 0)
- {
- x = 1;
- flag <<= CORBA::Any::from_boolean(x);
-
- pic->set_slot(slot, flag);
-
- // get server time
- std::cout << "Server Time = " << messenger->get_time() << std::endl;
- }
+ if (*recurse >>= CORBA::Any::to_boolean(x)) {
+ if (x == false)
+ {
+ x = true;
+ flag <<= CORBA::Any::from_boolean(x);
+
+ pic->set_slot(slot, flag);
+
+ // get server time
+ std::cout << "Server Time = " << messenger->get_time() << std::endl;
+ }
+ } else {
+ std::cerr << "Could not extract a boolean value from any" << std::endl;
+ }
+
// Add this context to the service context list.
- ri->add_request_service_context (sc, 0);
+ ri->add_request_service_context (sc, false);
// reset recursion test
- x = 0;
+ x = false;
flag <<= CORBA::Any::from_boolean(x);
pic->set_slot(slot,flag);