diff options
author | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-04-20 18:30:50 +0000 |
---|---|---|
committer | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-04-20 18:30:50 +0000 |
commit | fe26c2e8049da4774bd00fba0adca10ed0030250 (patch) | |
tree | 8c55a1d051544c2e42b21b10d6e400bd5fb060d4 /TAO/tao | |
parent | 1f345a6538494f328ad4a25a26047e2ee81a6aa8 (diff) | |
download | ATCD-fe26c2e8049da4774bd00fba0adca10ed0030250.tar.gz |
ChangeLogTag:Mon Apr 20 13:23:30 1998 Carlos O'Ryan <coryan@cs.wustl.edu>
Diffstat (limited to 'TAO/tao')
-rw-r--r-- | TAO/tao/Server_Request.cpp | 16 | ||||
-rw-r--r-- | TAO/tao/Server_Request.h | 3 |
2 files changed, 15 insertions, 4 deletions
diff --git a/TAO/tao/Server_Request.cpp b/TAO/tao/Server_Request.cpp index d11e94f187b..97c3ee4f8c6 100644 --- a/TAO/tao/Server_Request.cpp +++ b/TAO/tao/Server_Request.cpp @@ -222,6 +222,14 @@ IIOP_ServerRequest::set_exception (const CORBA::Any &value, { this->exception_ = new CORBA::Any; this->exception_->replace (value.type (), value.value (), 1, env); + + // @@ This cast is not safe, but we haven't implemented the >>= + // and <<= operators for base exceptions (yet). + CORBA_Exception* x = (CORBA_Exception*)value.value (); + if (CORBA_UserException::_narrow (x) != 0) + this->is_user_exception_ = 1; + else + this->is_user_exception_ = 0; } } @@ -386,20 +394,20 @@ IIOP_ServerRequest::init_reply (CORBA::Environment &env) // Any exception at all. else if (this->exception_) { - CORBA::Exception *x; CORBA::TypeCode_ptr except_tc; - x = (CORBA::Exception *) this->exception_->value (); except_tc = this->exception_->type (); // Finish the GIOP Reply header, then marshal the exception. // XXX x->type () someday ... - if (CORBA::UserException::_narrow (x)) + if (this->is_user_exception_) this->outgoing_->write_ulong (TAO_GIOP_USER_EXCEPTION); else this->outgoing_->write_ulong (TAO_GIOP_SYSTEM_EXCEPTION); - (void) this->outgoing_->encode (except_tc, x, 0, env); + + TAO_InputCDR cdr ((ACE_Message_Block*)this->exception_->value ()); + (void) this->outgoing_->append (except_tc, &cdr, env); } else // Normal reply // First finish the GIOP header ... diff --git a/TAO/tao/Server_Request.h b/TAO/tao/Server_Request.h index 594d5393ba3..a6b8ca88be9 100644 --- a/TAO/tao/Server_Request.h +++ b/TAO/tao/Server_Request.h @@ -259,6 +259,9 @@ private: CORBA::Any_ptr exception_; // Any exception which might be raised. + int is_user_exception_; + // Flag to decide if the exception was a user exception or not. + u_int refcount_; // Number of things hold references to here. |