diff options
author | mcorino <mcorino@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2014-11-12 09:10:27 +0000 |
---|---|---|
committer | mcorino <mcorino@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2014-11-12 09:10:27 +0000 |
commit | b69be02939ce0945480a81486c0d987cda26032d (patch) | |
tree | e37ea99fca88b3e6517a3ce7dcf21ec1f9117e93 /TAO/tests | |
parent | 78d7ad5c5ddd2352fdf5350f0e3721179a9c52d8 (diff) | |
download | ATCD-b69be02939ce0945480a81486c0d987cda26032d.tar.gz |
ChangelogTag: Wed Nov 12 09:00:15 UTC 2014 Martin Corino <mcorino@remedy.nl>
Diffstat (limited to 'TAO/tests')
-rw-r--r-- | TAO/tests/DSI_AMI_Gateway/My_DII_Reply_Handler.cpp | 63 | ||||
-rw-r--r-- | TAO/tests/DSI_AMI_Gateway/test_dsi.cpp | 6 |
2 files changed, 44 insertions, 25 deletions
diff --git a/TAO/tests/DSI_AMI_Gateway/My_DII_Reply_Handler.cpp b/TAO/tests/DSI_AMI_Gateway/My_DII_Reply_Handler.cpp index 283c97559ef..cf163876400 100644 --- a/TAO/tests/DSI_AMI_Gateway/My_DII_Reply_Handler.cpp +++ b/TAO/tests/DSI_AMI_Gateway/My_DII_Reply_Handler.cpp @@ -27,40 +27,57 @@ My_DII_Reply_Handler::handle_response(TAO_InputCDR &incoming) { CORBA::NVList_var opList; - try + if (!CORBA::is_nil (this->response_handler_.in())) { - this->orb_->create_list (0, opList.out()); + int org_byte_order = this->response_handler_->_tao_byte_order (); + try + { + this->orb_->create_list (0, opList.out()); - bool lazy_evaluation = true; - opList->_tao_incoming_cdr (incoming, - CORBA::ARG_OUT | CORBA::ARG_INOUT, - lazy_evaluation); + bool lazy_evaluation = true; + opList->_tao_incoming_cdr (incoming, + CORBA::ARG_OUT | CORBA::ARG_INOUT, + lazy_evaluation); - if (!CORBA::is_nil (this->response_handler_.in())) - this->response_handler_->invoke_reply (opList.in(), - 0 // result - ); + // make sure the response is sent on in the same byte order + // as initially received + this->response_handler_->_tao_byte_order (incoming.byte_order ()); - } - catch (CORBA::SystemException &ex) - { - TAO_AMH_DSI_Exception_Holder h (ex._tao_duplicate()); - response_handler_->invoke_excep(&h); - } - catch (...) - { - ACE_ERROR ((LM_ERROR, - "ERROR: Unknown Exception\n")); - TAO_AMH_DSI_Exception_Holder h (new CORBA::UNKNOWN()); - response_handler_->invoke_excep(&h); - } + this->response_handler_->invoke_reply (opList.in(), + 0 // result + ); + } + catch (CORBA::SystemException &ex) + { + // in this case the response originates locally so we + // need to reset the byte order again + this->response_handler_->_tao_byte_order (org_byte_order); + + TAO_AMH_DSI_Exception_Holder h (ex._tao_duplicate()); + response_handler_->invoke_excep(&h); + } + catch (...) + { + // in this case the response originates locally so we + // need to reset the byte order again + this->response_handler_->_tao_byte_order (org_byte_order); + ACE_ERROR ((LM_ERROR, + "ERROR: Unknown Exception\n")); + TAO_AMH_DSI_Exception_Holder h (new CORBA::UNKNOWN()); + response_handler_->invoke_excep(&h); + } + } } void My_DII_Reply_Handler::handle_excep (TAO_InputCDR &incoming, CORBA::ULong reply_status) { + // make sure the response is sent on in the same byte order + // as initially received + this->response_handler_->_tao_byte_order (incoming.byte_order ()); + ACE_DEBUG((LM_DEBUG, "calling My_DII_Reply_Handler::handle_excep()\n")); this->response_handler_->gateway_exception_reply (reply_status, incoming); diff --git a/TAO/tests/DSI_AMI_Gateway/test_dsi.cpp b/TAO/tests/DSI_AMI_Gateway/test_dsi.cpp index 1b56a99114f..5ac9d1ac72d 100644 --- a/TAO/tests/DSI_AMI_Gateway/test_dsi.cpp +++ b/TAO/tests/DSI_AMI_Gateway/test_dsi.cpp @@ -113,8 +113,10 @@ DSI_Simple_Server::invoke (CORBA::ServerRequest_ptr request, return; } - // Outgoing reply must have the same byte order as the incoming one. - request->_tao_reply_byte_order (target_request->_tao_byte_order ()); + // Regular replies are handled by the DII AMI/DSI AMH reply handler + // combination without further involvement of the request objects. + // The DII AMI reply handler must propagate the incoming reply + // byte order to the DSI AMH reply handler if (ACE_OS::strcmp ("shutdown", request->operation ()) == 0) { |