summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormayur <mayur@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-02-05 20:15:11 +0000
committermayur <mayur@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-02-05 20:15:11 +0000
commit397639951010eb4260a65db32e553bd85d188d23 (patch)
tree0cb9903c45d0c35814a764e924d120ced1c58ca9
parent34f0b59322570d3c67a10abf73d314ad50ae9a1c (diff)
downloadATCD-397639951010eb4260a65db32e553bd85d188d23.tar.gz
Wed Feb 5 12:10:08 2003 Mayur Deshpande <mayur@ics.uci.edu>
-rw-r--r--TAO/ChangeLog16
-rw-r--r--TAO/tao/PortableServer/AMH_Response_Handler.cpp30
-rw-r--r--TAO/tao/PortableServer/AMH_Response_Handler.h5
3 files changed, 36 insertions, 15 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index b8087f48bb5..49209ae8782 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,19 @@
+Wed Feb 5 12:10:08 2003 Mayur Deshpande <mayur@ics.uci.edu>
+
+ * tao/PortableServer/AMH_Response_Handler.cpp:
+ Added fix so that oneways work with AMH. Because of semantics of
+ oneways, the client doesn't expect any reply. The RH doesn't
+ know this and thinking that a RH is being destroyed before being
+ sent, it tries to send a exception to the client. This hangs the
+ server. The current fix handles oneways separately and doesn't
+ try and be 'intelligent' in the RH destruction process (and
+ doesn't try and send an exception to the cleint). Thanks to
+ Andrey Nechypurenko@mchp <Andrey.Nechypurenko@mchp.siemens.de>
+ for reporting a problem that led to uncovering of this
+ problem. Thanks to Balachandran Natarajan
+ <bala@isis-server.isis.vanderbilt.edu> for the suggestion to
+ retrieve the state from Server_Request to differentiate oneways.
+
Wed Feb 5 13:34:44 2003 Jeff Parsons <j.parsons@vanderbilt.edu>
* orbsvcs/orbsvcs/IFRService/InterfaceDef_i.cpp (create_attribute):
diff --git a/TAO/tao/PortableServer/AMH_Response_Handler.cpp b/TAO/tao/PortableServer/AMH_Response_Handler.cpp
index 9a81f90ba71..052d2dd9066 100644
--- a/TAO/tao/PortableServer/AMH_Response_Handler.cpp
+++ b/TAO/tao/PortableServer/AMH_Response_Handler.cpp
@@ -15,6 +15,7 @@ TAO_AMH_Response_Handler::
TAO_AMH_Response_Handler (TAO_ServerRequest &server_request)
: mesg_base_ (server_request.mesg_base_)
, request_id_ (server_request.request_id_)
+ , response_expected_ (server_request.response_expected_)
, transport_ (TAO_Transport::_duplicate (server_request.transport ()))
, orb_core_ (server_request.orb_core ())
, argument_flag_ (1)
@@ -30,6 +31,13 @@ TAO_AMH_Response_Handler::~TAO_AMH_Response_Handler (void)
{
ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_);
+// if (this->response_expected_ == 0) //oneway ?
+// {
+// // if client is not expecting anything, don't send anything
+// TAO_Transport::release (this->transport_);
+// return;
+// }
+
// If the ResponseHandler is being destroyed before a reply has
// been sent to the client, we send a system exception
// CORBA::NO_RESPONSE, with minor code to indicate the problem.
@@ -47,17 +55,17 @@ TAO_AMH_Response_Handler::~TAO_AMH_Response_Handler (void)
this->_tao_rh_send_exception (ex ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
- TAO_Transport::release (transport_);
+ TAO_Transport::release (this->transport_);
}
ACE_CATCHALL
{
- TAO_Transport::release (transport_);
+ TAO_Transport::release (this->transport_);
}
ACE_ENDTRY;
}
else
{
- TAO_Transport::release (transport_);
+ TAO_Transport::release (this->transport_);
}
}
}
@@ -165,14 +173,14 @@ TAO_AMH_Response_Handler::_tao_rh_send_exception (CORBA::Exception &ex
if (this->reply_status_ != TAO_RS_UNINITIALIZED)
{
ACE_THROW (CORBA::BAD_INV_ORDER (
- CORBA::SystemException::_tao_minor_code (
- TAO_AMH_REPLY_LOCATION_CODE,
- ENOTSUP),
- CORBA::COMPLETED_YES));
+ CORBA::SystemException::_tao_minor_code (
+ TAO_AMH_REPLY_LOCATION_CODE,
+ ENOTSUP),
+ CORBA::COMPLETED_YES));
}
this->reply_status_ = TAO_RS_SENDING;
}
-
+
TAO_Pluggable_Reply_Params_Base reply_params;
reply_params.request_id_ = this->request_id_;
reply_params.svc_ctx_.length (0);
@@ -184,14 +192,14 @@ TAO_AMH_Response_Handler::_tao_rh_send_exception (CORBA::Exception &ex
// ExceptionHolder information.
if (CORBA::SystemException::_downcast (&ex))
reply_params.reply_status_ = TAO_GIOP_SYSTEM_EXCEPTION;
-
+
if (this->mesg_base_->generate_exception_reply (this->_tao_out,
reply_params,
ex) == -1)
{
ACE_THROW (CORBA::INTERNAL ());
}
-
+
// Send the Exception
if (this->transport_->send_message (this->_tao_out,
0,
@@ -201,7 +209,7 @@ TAO_AMH_Response_Handler::_tao_rh_send_exception (CORBA::Exception &ex
ACE_TEXT ("TAO: (%P|%t|%N|%l): ")
ACE_TEXT ("TAO_AMH_Response_Handler: could not send exception reply\n")));
}
-
+
{
ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_);
this->reply_status_ = TAO_RS_SENT;
diff --git a/TAO/tao/PortableServer/AMH_Response_Handler.h b/TAO/tao/PortableServer/AMH_Response_Handler.h
index 33fa01179d8..d79cba1e8e1 100644
--- a/TAO/tao/PortableServer/AMH_Response_Handler.h
+++ b/TAO/tao/PortableServer/AMH_Response_Handler.h
@@ -113,10 +113,7 @@ private:
/// Copy of the request-id of the original Server-Request
CORBA::ULong request_id_;
- /// For AMH, this seems a little redundant
- // @@ Mayur: it is *NOT* oneways need to be supported via AMH too,
- // only sometimes they do not return anything!
- // CORBA::Boolean response_expected_;
+ CORBA::Boolean response_expected_;
/// Handle to transport through which the reply will be sent
/// Copy of transport in original Server_Request