summaryrefslogtreecommitdiff
path: root/TAO
diff options
context:
space:
mode:
Diffstat (limited to 'TAO')
-rw-r--r--TAO/ChangeLog20
-rw-r--r--TAO/tao/ClientRequestInfo_i.cpp50
-rw-r--r--TAO/tao/ClientRequestInfo_i.h5
3 files changed, 43 insertions, 32 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index b935a283803..46d0240571c 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,23 @@
+Wed Nov 20 15:15:02 2002 Ossama Othman <ossama@uci.edu>
+
+ * tao/ClientRequestInfo_i.h (setup_picurrent):
+
+ New method that sets up the thread scope and request scope
+ PICurrent objects on the client side.
+
+ * tao/ClientRequestInfo_i.cpp (TAO_ClientRequestInfo_i):
+ (setup_current):
+
+ Refactored duplicate code in both TAO_ClientRequestInfo_i
+ constructors to the new setup_picurrent() method.
+
+ Only set the TSC's peer if a copy was actually performed. Fixes
+ a seg fault after calling
+ PortableInterceptor::Current::set_slot() after a client
+ invocation was performed. Thanks to Philipp Leibfried
+ <pleibfried@speech-design.de> for providing a test case that
+ reproduced this problem.
+
Wed Nov 20 15:54:10 2002 Jeff Parsons <parsons@isis-server.isis.vanderbilt.edu>
* TAO_IDL/be/be_visitor_exception/exception_cs.cpp:
diff --git a/TAO/tao/ClientRequestInfo_i.cpp b/TAO/tao/ClientRequestInfo_i.cpp
index 26e31fbe365..0d2facea529 100644
--- a/TAO/tao/ClientRequestInfo_i.cpp
+++ b/TAO/tao/ClientRequestInfo_i.cpp
@@ -28,31 +28,7 @@ TAO_ClientRequestInfo_i::TAO_ClientRequestInfo_i (TAO_GIOP_Invocation *inv,
reply_status_ (-1),
rs_pi_current_ ()
{
-
- // Retrieve the thread scope current (no TSS access incurred yet).
- TAO_PICurrent *pi_current = inv->orb_core ()->pi_current ();
-
- // If the slot count is zero, then there is nothing to copy.
- // Prevent any copying (and hence TSS accesses) from occurring.
- if (pi_current != 0 && pi_current->slot_count () != 0)
- {
- // Retrieve the thread scope current.
- TAO_PICurrent_Impl *tsc = pi_current->tsc ();
-
- // Copy the TSC to the RSC.
- this->rs_pi_current_.copy (*tsc, 0); // Shallow copy
-
- // PICurrent will potentially have to call back on the request
- // scope current so that it can deep copy the contents of the
- // thread scope current if the contents of the thread scope
- // current are about to be modified. It is necessary to do this
- // deep copy once in order to completely isolate the request
- // scope current from the thread scope current. This is only
- // necessary, if the thread scope current is modified after its
- // contents have been *logically* copied to the request scope
- // current.
- tsc->pi_peer (&this->rs_pi_current_);
- }
+ this->setup_picurrent ();
}
TAO_ClientRequestInfo_i::TAO_ClientRequestInfo_i (
@@ -67,9 +43,19 @@ TAO_ClientRequestInfo_i::TAO_ClientRequestInfo_i (
reply_status_ (-1),
rs_pi_current_ ()
{
+ this->setup_picurrent ();
+}
+TAO_ClientRequestInfo_i::~TAO_ClientRequestInfo_i (void)
+{
+}
+
+void
+TAO_ClientRequestInfo_i::setup_picurrent (void)
+{
// Retrieve the thread scope current (no TSS access incurred yet).
- TAO_PICurrent *pi_current = inv->orb_core ()->pi_current ();
+ TAO_PICurrent *pi_current =
+ this->invocation_->orb_core ()->pi_current ();
// If the slot count is zero, then there is nothing to copy.
// Prevent any copying (and hence TSS accesses) from occurring.
@@ -90,14 +76,14 @@ TAO_ClientRequestInfo_i::TAO_ClientRequestInfo_i (
// necessary, if the thread scope current is modified after its
// contents have been *logically* copied to the request scope
// current.
- tsc->pi_peer (&this->rs_pi_current_);
+ //
+ // Only perform set the TSC's peer if a copy was actually
+ // performed.
+// if (this->rs_pi_current_.dirty ())
+ tsc->pi_peer (&this->rs_pi_current_);
}
}
-TAO_ClientRequestInfo_i::~TAO_ClientRequestInfo_i (void)
-{
-}
-
CORBA::Object_ptr
TAO_ClientRequestInfo_i::target (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
ACE_THROW_SPEC ((CORBA::SystemException))
@@ -178,7 +164,7 @@ TAO_ClientRequestInfo_i::received_exception (ACE_ENV_SINGLE_ARG_DECL)
ACE_NEW_THROW_EX (temp,
CORBA::Any,
CORBA::NO_MEMORY (
- CORBA_SystemException::_tao_minor_code (
+ CORBA::SystemException::_tao_minor_code (
TAO_DEFAULT_MINOR_CODE,
ENOMEM),
CORBA::COMPLETED_NO));
diff --git a/TAO/tao/ClientRequestInfo_i.h b/TAO/tao/ClientRequestInfo_i.h
index 49639e6a8ef..235ac9928d7 100644
--- a/TAO/tao/ClientRequestInfo_i.h
+++ b/TAO/tao/ClientRequestInfo_i.h
@@ -224,6 +224,11 @@ public:
protected:
+ /// Setup thread scope and request scope
+ /// PortableInterceptor::Current objects.
+ void setup_picurrent (void);
+
+
/// Helper method to get the request and response service contexts.
IOP::ServiceContext *get_service_context_i (
TAO_Service_Context &service_context_list,