summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-04-20 18:30:50 +0000
committercoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-04-20 18:30:50 +0000
commitfe26c2e8049da4774bd00fba0adca10ed0030250 (patch)
tree8c55a1d051544c2e42b21b10d6e400bd5fb060d4
parent1f345a6538494f328ad4a25a26047e2ee81a6aa8 (diff)
downloadATCD-fe26c2e8049da4774bd00fba0adca10ed0030250.tar.gz
ChangeLogTag:Mon Apr 20 13:23:30 1998 Carlos O'Ryan <coryan@cs.wustl.edu>
-rw-r--r--TAO/ChangeLog-98c8
-rw-r--r--TAO/tao/Server_Request.cpp16
-rw-r--r--TAO/tao/Server_Request.h3
3 files changed, 23 insertions, 4 deletions
diff --git a/TAO/ChangeLog-98c b/TAO/ChangeLog-98c
index bd0f22eaaa8..be2ba64e31e 100644
--- a/TAO/ChangeLog-98c
+++ b/TAO/ChangeLog-98c
@@ -1,3 +1,11 @@
+Mon Apr 20 13:23:30 1998 Carlos O'Ryan <coryan@cs.wustl.edu>
+
+ * tao/Server_Request.h:
+ * tao/Server_Request.cpp:
+ We keep a flag to determine whether the exceptions stored with
+ the set_exception() method are user exceptions or system
+ exceptions.
+
Mon Apr 20 09:48:01 1998 David L. Levine <levine@cs.wustl.edu>
* tests/CDR/growth.cpp (main): cast ACE_ONE_SECOND_IN_USECS
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.