diff options
author | gokhale <asgokhale@users.noreply.github.com> | 1998-03-25 01:19:36 +0000 |
---|---|---|
committer | gokhale <asgokhale@users.noreply.github.com> | 1998-03-25 01:19:36 +0000 |
commit | dcad7a517d5e5e295561a5fa58dfd32a66d74cd6 (patch) | |
tree | d85e7fd272e500ed384ea5522a2f0568286371bc | |
parent | d09ff0497469a79954794eba6219e8f140e4319c (diff) | |
download | ATCD-dcad7a517d5e5e295561a5fa58dfd32a66d74cd6.tar.gz |
*** empty log message ***
-rw-r--r-- | TAO/ChangeLog-98c | 16 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_exception.cpp | 2 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_exception.cpp | 2 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_operation.cpp | 5 | ||||
-rw-r--r-- | TAO/tao/Server_Request.cpp | 37 |
5 files changed, 46 insertions, 16 deletions
diff --git a/TAO/ChangeLog-98c b/TAO/ChangeLog-98c index c4a9441c980..d5d18bc479d 100644 --- a/TAO/ChangeLog-98c +++ b/TAO/ChangeLog-98c @@ -1,3 +1,17 @@ +Tue Mar 24 19:13:35 1998 Aniruddha Gokhale <gokhale@mambo.cs.wustl.edu> + + * tao/Server_Request.cpp: There was a lot of messy code on the + outgoing path from skeleton to the wire. Specifically, we were + mixing system exceptions with user defined exceptions. This has + been fixed and is under testing. + + * TAO_IDL/{be_visitor_exception, be_exception}.cpp: The generated + typecode for Exceptions erroneously had a "tk_struct" TypeCode + kind. This has been fixed to be "tk_except". + + * TAO_IDL/be_visitor_operation.cpp: Handling of oneway operations + in the server skeletons was buggy. It is now fixed. + Tue Mar 24 14:51:33 1998 Nanbor Wang <nanbor@cs.wustl.edu> * TAO_IDL/be/be_interface.cpp (gen_server_skeletons): Changed @@ -8,7 +22,7 @@ Tue Mar 24 14:51:33 1998 Nanbor Wang <nanbor@cs.wustl.edu> * tao/IIOP_Object.cpp: Initialze TAO_Synchronous_Cancellation_Required::old_type_. - + Tue Mar 24 14:07:08 1998 Aniruddha Gokhale <gokhale@mambo.cs.wustl.edu> * tao/Server_Request.{h, i, cpp}: Made the class compliant with diff --git a/TAO/TAO_IDL/be/be_exception.cpp b/TAO/TAO_IDL/be/be_exception.cpp index 975c4381ed6..b8eb55018d1 100644 --- a/TAO/TAO_IDL/be/be_exception.cpp +++ b/TAO/TAO_IDL/be/be_exception.cpp @@ -377,7 +377,7 @@ be_exception::gen_client_stubs (void) *cs << "};" << nl; *cs << "static CORBA::TypeCode _tc__tc_" << this->flatname () << - " (CORBA::tk_struct, sizeof (_oc_" << this->flatname () << + " (CORBA::tk_except, sizeof (_oc_" << this->flatname () << "), (char *) &_oc_" << this->flatname () << ", CORBA::B_FALSE);" << nl; *cs << "CORBA::TypeCode_ptr " << this->tc_name () << " = &_tc__tc_" << diff --git a/TAO/TAO_IDL/be/be_visitor_exception.cpp b/TAO/TAO_IDL/be/be_visitor_exception.cpp index 75e4bdb889d..88136b1c1fd 100644 --- a/TAO/TAO_IDL/be/be_visitor_exception.cpp +++ b/TAO/TAO_IDL/be/be_visitor_exception.cpp @@ -414,7 +414,7 @@ int be_visitor_exception_cs::visit_exception (be_exception *node) *os << "};" << be_nl; *os << "static CORBA::TypeCode _tc__tc_" << node->flatname () << - " (CORBA::tk_struct, sizeof (_oc_" << node->flatname () << + " (CORBA::tk_except, sizeof (_oc_" << node->flatname () << "), (char *) &_oc_" << node->flatname () << ", CORBA::B_FALSE);" << be_nl; *os << "CORBA::TypeCode_ptr " << node->tc_name () << " = &_tc__tc_" << diff --git a/TAO/TAO_IDL/be/be_visitor_operation.cpp b/TAO/TAO_IDL/be/be_visitor_operation.cpp index 95f2209f3e6..cde24e628d6 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation.cpp @@ -997,7 +997,7 @@ be_visitor_operation_ss::visit_operation (be_operation *node) *os << "_tao_environment"; // end the upcall *os << be_uidt_nl; - *os << ");" << be_nl; + *os << ");\n"; // STEP 3F: do any post processing for the arguments ctx = *this->ctx_; @@ -1016,7 +1016,7 @@ be_visitor_operation_ss::visit_operation (be_operation *node) // STEP 3G: check if we are oneway in which case, we are done if (node->flags () == AST_Operation::OP_oneway) { - // we are done. Nothing else to do, except closing the funciton body. + // we are done. Nothing else to do, except closing the funciton body. os->decr_indent (); *os << "}\n\n"; return 0; @@ -1024,6 +1024,7 @@ be_visitor_operation_ss::visit_operation (be_operation *node) // STEP 3H: setup parameters for marshaling and marshal them into the // outgoing stream + os->indent (); *os << "_tao_server_request.marshal (" << be_idt_nl << "_tao_environment, " << be_nl << "&"; diff --git a/TAO/tao/Server_Request.cpp b/TAO/tao/Server_Request.cpp index eca7c47fca1..62409aaedef 100644 --- a/TAO/tao/Server_Request.cpp +++ b/TAO/tao/Server_Request.cpp @@ -183,7 +183,10 @@ IIOP_ServerRequest::set_result (const CORBA::Any &value, if (!this->params_ || this->retval_ || this->exception_) env.exception (new CORBA::BAD_INV_ORDER (CORBA::COMPLETED_NO)); else - this->retval_ = new CORBA::Any (value); + { + this->retval_ = new CORBA::Any; + this->retval_->replace (value.type (), value.value (), 1, env); + } } // Store the exception value. @@ -196,8 +199,8 @@ IIOP_ServerRequest::set_exception (const CORBA::Any &value, env.exception (new CORBA::BAD_INV_ORDER (CORBA::COMPLETED_NO)); else { - env.clear (); - this->exception_ = new CORBA::Any (value); + this->exception_ = new CORBA::Any; + this->exception_->replace (value.type (), value.value (), 1, env); } } @@ -255,6 +258,23 @@ IIOP_ServerRequest::marshal (CORBA::Environment &env, // exception reporting const TAO_Call_Data_Skel *info, // call description ...) // ... any parameters { + CORBA::Environment env2; + + // check if we are inside with an exception. This may have happened + // since the upcall could have set some exception + if (env.exception ()) + { + CORBA::Any any (env.exception ()->_type (), env.exception ()); // don't + // own it + this->set_exception (any, env2); + } + + // Setup a Reply message. + this->init_reply (env2); + + if (env2.exception () || env.exception ()) // exception, nothing to do + return; + // Now, put all "in" and "inout" parameters into the NVList. CORBA::ULong i; CORBA::ULong j; @@ -284,12 +304,8 @@ IIOP_ServerRequest::marshal (CORBA::Environment &env, // exception reporting j++; } - va_end (param_vector); - // Setup a Reply message. - this->init_reply (env); - // Normal reply. if (!env.exception ()) { @@ -358,11 +374,10 @@ IIOP_ServerRequest::init_reply (CORBA::Environment &env) // Finish the GIOP Reply header, then marshal the exception. // XXX x->type () someday ... - // if (this->ex_type_ == CORBA::SYSTEM_EXCEPTION) - if (1) - this->outgoing_->put_ulong (TAO_GIOP_SYSTEM_EXCEPTION); - else + if (CORBA::UserException::_narrow (x)) this->outgoing_->put_ulong (TAO_GIOP_USER_EXCEPTION); + else + this->outgoing_->put_ulong (TAO_GIOP_SYSTEM_EXCEPTION); (void) this->outgoing_->encode (except_tc, x, 0, env); } else // Normal reply |