diff options
author | marina <marina@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-12-04 19:24:03 +0000 |
---|---|---|
committer | marina <marina@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-12-04 19:24:03 +0000 |
commit | 39b906774d30ccff4a7fc1badff3a898a3b7b0f2 (patch) | |
tree | 9df4d02fe338dcd1227645a1bfc850049e2e1160 /TAO | |
parent | b0db4f6318767aacef5880ff97f8b770b86f4601 (diff) | |
download | ATCD-39b906774d30ccff4a7fc1badff3a898a3b7b0f2.tar.gz |
ChangeLogTag:Mon Dec 4 13:04:55 2000 Marina Spivak <marina@cs.wustl.edu>
Diffstat (limited to 'TAO')
-rw-r--r-- | TAO/ChangeLogs/ChangeLog-02a | 10 | ||||
-rw-r--r-- | TAO/tao/Invocation.cpp | 23 | ||||
-rw-r--r-- | TAO/tao/Invocation.h | 3 |
3 files changed, 30 insertions, 6 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a index db6678c74e3..48945d52bbd 100644 --- a/TAO/ChangeLogs/ChangeLog-02a +++ b/TAO/ChangeLogs/ChangeLog-02a @@ -1,3 +1,13 @@ +Mon Dec 4 13:04:55 2000 Marina Spivak <marina@cs.wustl.edu> + + * tao/Invocation.h + * tao/Invocation.cpp (create_ior_info): + + Updated the method to return proper index of the profile being + used for the Invocation even when RTCORBA policies are used. In + other words, TAO_Target_Specification::Reference_Addr scheme now + works with RTCORBA policies. + Sun Dec 3 00:21:09 2000 Christopher Kohlhoff <chris@kohlhoff.com> * tao/Makefile.bor: diff --git a/TAO/tao/Invocation.cpp b/TAO/tao/Invocation.cpp index 86deea3bbdf..88a2c2196cd 100644 --- a/TAO/tao/Invocation.cpp +++ b/TAO/tao/Invocation.cpp @@ -342,8 +342,6 @@ TAO_GIOP_Invocation::prepare_header (CORBA::Octet response_flags, // We need to call the method seperately. If there is no // IOP::IOR info, the call would create the info and return the // index that we need. - // @@Will not work for RT CORBA as the index we get would be - // wrong. CORBA::ULong index = this->create_ior_info (); this->target_spec_.target_specifier (this->ior_info_, index); @@ -506,9 +504,6 @@ TAO_GIOP_Invocation::location_forward (TAO_InputCDR &inp_stream, CORBA::ULong TAO_GIOP_Invocation::create_ior_info (void) { - // Get the list of profiles - const TAO_MProfile &mprofile = this->stub_->base_profiles (); - if (this->ior_info_.profiles.length () == 0) { // We are making a copy, it is expensive. We want a copy of the @@ -518,6 +513,9 @@ TAO_GIOP_Invocation::create_ior_info (void) // get the info // @@ There should be a better way to do this - Bala + // @@ Bala, your code is not exception-safe. The call below + // allocates memory, and could very well return 0. In such + // case, the second call below would seg fault. TAO_MProfile *multi_prof = this->stub_->make_profiles (); @@ -539,6 +537,21 @@ TAO_GIOP_Invocation::create_ior_info (void) delete multi_prof; } + // Figure out the index of the profile we are using for invocation. + + // @@ Bala, you are using base_profiles, which means this will not + // work if there was forwarding ... But it seems the problem isn't + // just here, but the whole addressing mode thing won't work if + // there was forwarding. + const TAO_MProfile &mprofile = this->stub_->base_profiles (); + + for (CORBA::ULong i = 0; i < mprofile.profile_count (); ++i) + { + if (mprofile.get_profile (i) == this->profile_) + return i; + + } + // If there was forwarding the loop above won't find a match. return mprofile.get_current_handle (); } diff --git a/TAO/tao/Invocation.h b/TAO/tao/Invocation.h index 822a9c09f26..57bde43b23f 100644 --- a/TAO/tao/Invocation.h +++ b/TAO/tao/Invocation.h @@ -167,7 +167,8 @@ protected: CORBA::ULong create_ior_info (void); // Create the IOP::IOR info. We will create the info atmost - // once. This method will not work for RTCorba - Bala + // once. Return index of the profile we are using to make the + // invocation. void add_rt_service_context (CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()); |