diff options
Diffstat (limited to 'TAO')
-rw-r--r-- | TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Connector.cpp | 2 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp | 8 | ||||
-rw-r--r-- | TAO/tao/IIOP_Connector.cpp | 8 | ||||
-rw-r--r-- | TAO/tao/LF_CH_Event.cpp | 4 | ||||
-rw-r--r-- | TAO/tao/LF_CH_Event.h | 16 | ||||
-rw-r--r-- | TAO/tao/LF_Connect_Strategy.cpp | 2 | ||||
-rw-r--r-- | TAO/tao/LF_Event.cpp | 24 | ||||
-rw-r--r-- | TAO/tao/LF_Event.h | 17 | ||||
-rw-r--r-- | TAO/tao/LF_Event.inl | 4 | ||||
-rw-r--r-- | TAO/tao/LF_Invocation_Event.cpp | 4 | ||||
-rw-r--r-- | TAO/tao/LF_Invocation_Event.h | 17 | ||||
-rw-r--r-- | TAO/tao/LF_Multi_Event.cpp | 8 | ||||
-rw-r--r-- | TAO/tao/LF_Multi_Event.h | 22 | ||||
-rw-r--r-- | TAO/tao/Leader_Follower.cpp | 20 | ||||
-rw-r--r-- | TAO/tao/Reactive_Connect_Strategy.cpp | 6 | ||||
-rw-r--r-- | TAO/tao/Strategies/SCIOP_Connector.cpp | 9 | ||||
-rw-r--r-- | TAO/tao/Strategies/SHMIOP_Connector.cpp | 11 | ||||
-rw-r--r-- | TAO/tao/Strategies/UIOP_Connector.cpp | 8 | ||||
-rw-r--r-- | TAO/tao/Transport_Connector.cpp | 2 | ||||
-rw-r--r-- | TAO/tao/Wait_On_Reactor.cpp | 11 | ||||
-rw-r--r-- | TAO/tao/Wait_On_Read.cpp | 14 | ||||
-rw-r--r-- | TAO/tests/Bug_3531b_Regression/server.cpp | 7 |
22 files changed, 136 insertions, 88 deletions
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Connector.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Connector.cpp index f920fe33b4a..3029c05c3e5 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Connector.cpp +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/IIOP_SSL_Connector.cpp @@ -191,7 +191,7 @@ TAO::IIOP_SSL_Connector::make_connection ( return 0; } - if (svc_handler->keep_waiting ()) + if (svc_handler->keep_waiting (this->orb_core ()->leader_follower ())) { svc_handler->connection_pending (); } diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp index 6b17c141510..eb6303b9b37 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp @@ -671,14 +671,16 @@ TAO::SSLIOP::Connector::ssliop_connect ( return 0; } + TAO_Leader_Follower &leader_follower = this->orb_core ()->leader_follower (); + // fix for bug 2654 - if (svc_handler->keep_waiting ()) + if (svc_handler->keep_waiting (leader_follower)) { svc_handler->connection_pending (); } // fix for bug 2654 - if (svc_handler->error_detected ()) + if (svc_handler->error_detected (leader_follower)) { svc_handler->cancel_pending_connection (); } @@ -732,7 +734,7 @@ TAO::SSLIOP::Connector::ssliop_connect ( } // fix for bug 2654 - if (svc_handler->error_detected ()) + if (svc_handler->error_detected (leader_follower)) { svc_handler->cancel_pending_connection (); transport->purge_entry(); diff --git a/TAO/tao/IIOP_Connector.cpp b/TAO/tao/IIOP_Connector.cpp index 33b73629a3b..c40bf59940c 100644 --- a/TAO/tao/IIOP_Connector.cpp +++ b/TAO/tao/IIOP_Connector.cpp @@ -575,7 +575,9 @@ TAO_IIOP_Connector::complete_connection (int result, return 0; } - if (svc_handler->keep_waiting()) + TAO_Leader_Follower &leader_follower = this->orb_core ()->leader_follower (); + + if (svc_handler->keep_waiting(leader_follower)) { svc_handler->connection_pending(); } @@ -591,7 +593,7 @@ TAO_IIOP_Connector::complete_connection (int result, #endif // INDUCE_BUG_2654_B // Fix for bug 2654. - if (transport->connection_handler()->error_detected()) + if (transport->connection_handler()->error_detected(leader_follower)) { if (TAO_debug_level > 0) TAOLIB_DEBUG((LM_DEBUG, @@ -652,7 +654,7 @@ TAO_IIOP_Connector::complete_connection (int result, // before caching, the connection really failed, thus an invalid // connection is put into the cache. Thus we do one last status // check before handing the connection back to the caller. - if (svc_handler->error_detected()) + if (svc_handler->error_detected(leader_follower)) { if (TAO_debug_level > 0) TAOLIB_DEBUG((LM_DEBUG, diff --git a/TAO/tao/LF_CH_Event.cpp b/TAO/tao/LF_CH_Event.cpp index e2507549c2c..735041be0e4 100644 --- a/TAO/tao/LF_CH_Event.cpp +++ b/TAO/tao/LF_CH_Event.cpp @@ -110,7 +110,7 @@ TAO_LF_CH_Event::validate_state_change (int new_state) bool -TAO_LF_CH_Event::successful (void) const +TAO_LF_CH_Event::successful_i (void) const { if (this->prev_state_ == TAO_LF_Event::LFS_CONNECTION_WAIT) return this->state_ == TAO_LF_Event::LFS_SUCCESS; @@ -119,7 +119,7 @@ TAO_LF_CH_Event::successful (void) const } bool -TAO_LF_CH_Event::error_detected (void) const +TAO_LF_CH_Event::error_detected_i (void) const { if (this->prev_state_ == TAO_LF_Event::LFS_CONNECTION_WAIT) return this->state_ == TAO_LF_Event::LFS_CONNECTION_CLOSED; diff --git a/TAO/tao/LF_CH_Event.h b/TAO/tao/LF_CH_Event.h index b651e80d93b..4acb65afcdf 100644 --- a/TAO/tao/LF_CH_Event.h +++ b/TAO/tao/LF_CH_Event.h @@ -55,14 +55,6 @@ public: virtual ~TAO_LF_CH_Event (void); //@{ - /// Return true if the condition was satisfied successfully, false if it - /// has not - bool successful (void) const; - - /// Return true if an error was detected while waiting for the - /// event - bool error_detected (void) const; - protected: /// Check whether we have reached the final state.. @@ -107,6 +99,14 @@ private: */ virtual void state_changed_i (int new_state); + /// Return true if the condition was satisfied successfully, false if it + /// has not + virtual bool successful_i (void) const; + + /// Return true if an error was detected while waiting for the + /// event + virtual bool error_detected_i (void) const; + /// Set the state irrespective of anything. virtual void set_state (int new_state); diff --git a/TAO/tao/LF_Connect_Strategy.cpp b/TAO/tao/LF_Connect_Strategy.cpp index 3f1ae449589..8bc6dce0c6c 100644 --- a/TAO/tao/LF_Connect_Strategy.cpp +++ b/TAO/tao/LF_Connect_Strategy.cpp @@ -52,7 +52,7 @@ TAO_LF_Connect_Strategy::wait_i (TAO_LF_Event *ev, int result = leader_follower.wait_for_event (ev, transport, max_wait_time); - if (ev->error_detected () && result != -1) + if (ev->error_detected (leader_follower) && result != -1) result = -1; return result; diff --git a/TAO/tao/LF_Event.cpp b/TAO/tao/LF_Event.cpp index 9211f91f8ae..c7a02b83935 100644 --- a/TAO/tao/LF_Event.cpp +++ b/TAO/tao/LF_Event.cpp @@ -35,6 +35,30 @@ TAO_LF_Event::state_changed (int new_state, TAO_Leader_Follower &lf) } } +bool +TAO_LF_Event::keep_waiting (TAO_Leader_Follower &lf) const +{ + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, lf.lock (), false); + + return this->keep_waiting_i (); +} + +bool +TAO_LF_Event::successful (TAO_Leader_Follower &lf) const +{ + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, lf.lock (), false); + + return this->successful_i (); +} + +bool +TAO_LF_Event::error_detected (TAO_Leader_Follower &lf) const +{ + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, lf.lock (), false); + + return this->error_detected_i (); +} + void TAO_LF_Event::set_state (int new_state) { diff --git a/TAO/tao/LF_Event.h b/TAO/tao/LF_Event.h index 692e37b8467..6ea3f87001b 100644 --- a/TAO/tao/LF_Event.h +++ b/TAO/tao/LF_Event.h @@ -108,14 +108,14 @@ public: */ /// Return true if the condition was satisfied successfully, false if it /// has not - virtual bool successful (void) const = 0 ; + bool successful (TAO_Leader_Follower &lf) const; /// Return true if an error was detected while waiting for the /// event - virtual bool error_detected (void) const = 0; + bool error_detected (TAO_Leader_Follower &lf) const; /// Check if we should keep waiting. - bool keep_waiting (void) const; + bool keep_waiting (TAO_Leader_Follower &lf) const; //@} /// Reset the state, irrespective of the previous states @@ -128,6 +128,17 @@ protected: /// Validate the state change virtual void state_changed_i (int new_state) = 0; + /// Check if we should keep waiting. + bool keep_waiting_i (void) const; + + /// Return true if the condition was satisfied successfully, false if it + /// has not + virtual bool successful_i (void) const = 0 ; + + /// Return true if an error was detected while waiting for the + /// event + virtual bool error_detected_i (void) const = 0; + /// Check whether we have reached the final state.. virtual bool is_state_final (void) const = 0; diff --git a/TAO/tao/LF_Event.inl b/TAO/tao/LF_Event.inl index cceb7a15ed7..50ccda83b25 100644 --- a/TAO/tao/LF_Event.inl +++ b/TAO/tao/LF_Event.inl @@ -26,9 +26,9 @@ TAO_LF_Event::reset_state (int new_state) } ACE_INLINE bool -TAO_LF_Event::keep_waiting (void) const +TAO_LF_Event::keep_waiting_i (void) const { - return (!this->successful ()) && (!this->error_detected ()); + return (!this->successful_i ()) && (!this->error_detected_i ()); } ACE_INLINE const char * diff --git a/TAO/tao/LF_Invocation_Event.cpp b/TAO/tao/LF_Invocation_Event.cpp index b98802fd9d6..060a9c49975 100644 --- a/TAO/tao/LF_Invocation_Event.cpp +++ b/TAO/tao/LF_Invocation_Event.cpp @@ -62,13 +62,13 @@ TAO_LF_Invocation_Event::state_changed_i (int new_state) } bool -TAO_LF_Invocation_Event::successful (void) const +TAO_LF_Invocation_Event::successful_i (void) const { return this->state_ == TAO_LF_Event::LFS_SUCCESS; } bool -TAO_LF_Invocation_Event::error_detected (void) const +TAO_LF_Invocation_Event::error_detected_i (void) const { return (this->state_ == TAO_LF_Event::LFS_FAILURE || this->state_ == TAO_LF_Event::LFS_TIMEOUT diff --git a/TAO/tao/LF_Invocation_Event.h b/TAO/tao/LF_Invocation_Event.h index 5e0a874aebe..25d387f667b 100644 --- a/TAO/tao/LF_Invocation_Event.h +++ b/TAO/tao/LF_Invocation_Event.h @@ -42,15 +42,6 @@ public: /// Destructor virtual ~TAO_LF_Invocation_Event (void); - /// Return true if the condition was satisfied successfully, false if it - /// has not - bool successful (void) const; - - /// Return true if an error was detected while waiting for the - /// event - bool error_detected (void) const; - //@} - protected: /// Validate and perform the state change @@ -70,6 +61,14 @@ protected: */ virtual void state_changed_i (int new_state); + /// Return true if the condition was satisfied successfully, false if it + /// has not + virtual bool successful_i (void) const; + + /// Return true if an error was detected while waiting for the + /// event + virtual bool error_detected_i (void) const; + private: /// Check whether we have reached the final state.. bool is_state_final (void) const; diff --git a/TAO/tao/LF_Multi_Event.cpp b/TAO/tao/LF_Multi_Event.cpp index 983149dba07..c0741bad8de 100644 --- a/TAO/tao/LF_Multi_Event.cpp +++ b/TAO/tao/LF_Multi_Event.cpp @@ -79,10 +79,10 @@ TAO_LF_Multi_Event::base_transport (void) } bool -TAO_LF_Multi_Event::successful (void) const +TAO_LF_Multi_Event::successful_i (void) const { for (Event_Node *n = this->events_; n != 0; n = n->next_) - if (n->ptr_->successful()) + if (n->ptr_->successful_i()) { this->winner_ = n->ptr_; return true; @@ -91,11 +91,11 @@ TAO_LF_Multi_Event::successful (void) const } bool -TAO_LF_Multi_Event::error_detected (void) const +TAO_LF_Multi_Event::error_detected_i (void) const { for (Event_Node *n = this->events_; n != 0; n = n->next_) { - if (!n->ptr_->error_detected ()) + if (!n->ptr_->error_detected_i ()) { return false; } diff --git a/TAO/tao/LF_Multi_Event.h b/TAO/tao/LF_Multi_Event.h index c10fd9545f4..c0cc2916169 100644 --- a/TAO/tao/LF_Multi_Event.h +++ b/TAO/tao/LF_Multi_Event.h @@ -59,18 +59,6 @@ public: /// Returns the transport associated with the first entry in the collection. TAO_Transport *base_transport(void); - //@{ - /// Return true if the condition was satisfied successfully, false if it - /// has not - This iterates over the list of attached events and - /// returns true if any of them return true from successful. - bool successful (void) const; - - /// Return true if an error was detected while waiting for the - /// event - This iterates over the list of events and returns - /// true only if all of them return true from error_detected(). - bool error_detected (void) const; - - //@} private: void operator= (const TAO_LF_Multi_Event &); TAO_LF_Multi_Event (const TAO_LF_Multi_Event &); @@ -83,6 +71,16 @@ protected: /// Check whether we have reached the final state.. virtual bool is_state_final (void) const; + /// Return true if the condition was satisfied successfully, false if it + /// has not - This iterates over the list of attached events and + /// returns true if any of them return true from successful. + virtual bool successful_i (void) const; + + /// Return true if an error was detected while waiting for the + /// event - This iterates over the list of events and returns + /// true only if all of them return true from error_detected(). + virtual bool error_detected_i (void) const; + private: struct Event_Node { diff --git a/TAO/tao/Leader_Follower.cpp b/TAO/tao/Leader_Follower.cpp index 18c3fe60b57..62b3527edd8 100644 --- a/TAO/tao/Leader_Follower.cpp +++ b/TAO/tao/Leader_Follower.cpp @@ -281,7 +281,7 @@ TAO_Leader_Follower::wait_for_event (TAO_LF_Event *event, // still not completed (and we haven't run out of time). // All the conditions below are basically the various ways the // leader loop below can end, other than the event being complete - while (event->keep_waiting () + while (event->keep_waiting_i () && !(result == 0 && max_wait_time != 0 && *max_wait_time == ACE_Time_Value::zero) @@ -309,7 +309,7 @@ TAO_Leader_Follower::wait_for_event (TAO_LF_Event *event, // get a signal when the event terminates TAO_LF_Event_Binder event_binder (event, follower.get ()); - while (event->keep_waiting () && + while (event->keep_waiting_i () && this->leader_available ()) { // Scope #4: this loop handles spurious wake-ups // Add ourselves to the list, do it everytime we wake up @@ -374,7 +374,7 @@ TAO_Leader_Follower::wait_for_event (TAO_LF_Event *event, // We have timedout event->set_state (TAO_LF_Event::LFS_TIMEOUT); - if (!event->successful ()) + if (!event->successful_i ()) { // Remove follower can fail because either // 1) the condition was satisfied (i.e. reply @@ -420,15 +420,15 @@ TAO_Leader_Follower::wait_for_event (TAO_LF_Event *event, ACE_TEXT ("TAO (%P|%t) - Leader_Follower[%d]::wait_for_event,") ACE_TEXT (" done (follower), successful %d\n"), t_id, - event->successful ())); + event->successful_i ())); // Now somebody woke us up to become a leader or to handle our // input. We are already removed from the follower queue. - if (event->successful ()) + if (event->successful_i ()) return 0; - if (event->error_detected ()) + if (event->error_detected_i ()) return -1; // FALLTHROUGH @@ -499,7 +499,7 @@ TAO_Leader_Follower::wait_for_event (TAO_LF_Event *event, // If we got our event, no need to run the event loop any // further. - while (event->keep_waiting ()) + while (event->keep_waiting_i ()) { // Run the event loop. result = reactor->handle_events (max_wait_time); @@ -602,13 +602,13 @@ TAO_Leader_Follower::wait_for_event (TAO_LF_Event *event, // Return an error if there was a problem receiving the reply... if (max_wait_time != 0) { - if (!event->successful () + if (!event->successful_i () && *max_wait_time == ACE_Time_Value::zero) { result = -1; errno = ETIME; } - else if (event->error_detected ()) + else if (event->error_detected_i ()) { // If the time did not expire yet, but we get a failure, // e.g. the connections closed, we should still return an error. @@ -624,7 +624,7 @@ TAO_Leader_Follower::wait_for_event (TAO_LF_Event *event, * clients. * result = 0; */ - if (event->error_detected ()) + if (event->error_detected_i ()) { result = -1; } diff --git a/TAO/tao/Reactive_Connect_Strategy.cpp b/TAO/tao/Reactive_Connect_Strategy.cpp index 9af1d96c729..db4e03fc623 100644 --- a/TAO/tao/Reactive_Connect_Strategy.cpp +++ b/TAO/tao/Reactive_Connect_Strategy.cpp @@ -55,9 +55,11 @@ TAO_Reactive_Connect_Strategy::wait_i (TAO_LF_Event *ev, //FUZZ: enable check_for_lack_ACE_OS } + TAO_Leader_Follower &leader_follower = this->orb_core_->leader_follower (); + try { - while (ev->keep_waiting ()) + while (ev->keep_waiting (leader_follower)) { result = this->orb_core_->run (max_wait_time, 1); @@ -83,7 +85,7 @@ TAO_Reactive_Connect_Strategy::wait_i (TAO_LF_Event *ev, } // Set the result. - if (result != -1 && ev->error_detected ()) + if (result != -1 && ev->error_detected (leader_follower)) { result = -1; } diff --git a/TAO/tao/Strategies/SCIOP_Connector.cpp b/TAO/tao/Strategies/SCIOP_Connector.cpp index 3f88e558447..c263df359af 100644 --- a/TAO/tao/Strategies/SCIOP_Connector.cpp +++ b/TAO/tao/Strategies/SCIOP_Connector.cpp @@ -236,12 +236,15 @@ TAO_SCIOP_Connector::make_connection_i (TAO::Profile_Transport_Resolver *r, return 0; } - if (svc_handler->keep_waiting ()) + TAO_Leader_Follower &leader_follower = this->orb_core ()->leader_follower (); + + + if (svc_handler->keep_waiting (leader_follower)) { svc_handler->connection_pending (); } - if (svc_handler->error_detected ()) + if (svc_handler->error_detected (leader_follower)) { svc_handler->cancel_pending_connection (); return 0; @@ -278,7 +281,7 @@ TAO_SCIOP_Connector::make_connection_i (TAO::Profile_Transport_Resolver *r, return 0; } - if (svc_handler->error_detected ()) + if (svc_handler->error_detected (leader_follower) { svc_handler->cancel_pending_connection (); transport->purge_entry(); diff --git a/TAO/tao/Strategies/SHMIOP_Connector.cpp b/TAO/tao/Strategies/SHMIOP_Connector.cpp index 2f5e4e426be..bcf909b54ee 100644 --- a/TAO/tao/Strategies/SHMIOP_Connector.cpp +++ b/TAO/tao/Strategies/SHMIOP_Connector.cpp @@ -173,18 +173,19 @@ TAO_SHMIOP_Connector::make_connection (TAO::Profile_Transport_Resolver *, return 0; } - if (svc_handler->keep_waiting ()) + TAO_Leader_Follower &leader_follower = this->orb_core ()->leader_follower (); + + if (svc_handler->keep_waiting (leader_follower)) { svc_handler->connection_pending (); } - if (svc_handler->error_detected ()) + if (svc_handler->error_detected (leader_follower)) { svc_handler->cancel_pending_connection (); } - TAO_Transport *transport = - svc_handler->transport (); + TAO_Transport *transport = svc_handler->transport (); // At this point, the connection has be successfully connected. // #REFCOUNT# is one. @@ -218,7 +219,7 @@ TAO_SHMIOP_Connector::make_connection (TAO::Profile_Transport_Resolver *, return 0; } - if (svc_handler->error_detected ()) + if (svc_handler->error_detected (leader_follower)) { svc_handler->cancel_pending_connection (); transport->purge_entry(); diff --git a/TAO/tao/Strategies/UIOP_Connector.cpp b/TAO/tao/Strategies/UIOP_Connector.cpp index 3b9e56f6067..1d739ccd8c8 100644 --- a/TAO/tao/Strategies/UIOP_Connector.cpp +++ b/TAO/tao/Strategies/UIOP_Connector.cpp @@ -210,12 +210,14 @@ TAO_UIOP_Connector::make_connection (TAO::Profile_Transport_Resolver *r, return 0; } - if (svc_handler->keep_waiting ()) + TAO_Leader_Follower &leader_follower = this->orb_core ()->leader_follower (); + + if (svc_handler->keep_waiting (leader_follower)) { svc_handler->connection_pending (); } - if (svc_handler->error_detected ()) + if (svc_handler->error_detected (leader_follower)) { svc_handler->cancel_pending_connection (); } @@ -250,7 +252,7 @@ TAO_UIOP_Connector::make_connection (TAO::Profile_Transport_Resolver *r, return 0; } - if (svc_handler->error_detected ()) + if (svc_handler->error_detected (leader_follower)) { svc_handler->cancel_pending_connection (); transport->purge_entry(); diff --git a/TAO/tao/Transport_Connector.cpp b/TAO/tao/Transport_Connector.cpp index 9ea721d8789..e6f2bdfeca3 100644 --- a/TAO/tao/Transport_Connector.cpp +++ b/TAO/tao/Transport_Connector.cpp @@ -502,7 +502,7 @@ TAO_Connector::connect (TAO::Profile_Transport_Resolver *r, { TAO_Connection_Handler *ch = base_transport->connection_handler (); // one last check before using the cached connection - if (ch->error_detected ()) + if (ch->error_detected (this->orb_core ()->leader_follower ())) { if (TAO_debug_level > 0) { diff --git a/TAO/tao/Wait_On_Reactor.cpp b/TAO/tao/Wait_On_Reactor.cpp index a36cadfa796..7232bf64838 100644 --- a/TAO/tao/Wait_On_Reactor.cpp +++ b/TAO/tao/Wait_On_Reactor.cpp @@ -29,6 +29,9 @@ TAO_Wait_On_Reactor::wait (ACE_Time_Value *max_wait_time, ACE_Reactor *const reactor = this->transport_->orb_core ()->reactor (); + TAO_Leader_Follower &leader_follower = + this->transport_->orb_core ()->leader_follower (); + // Do the event loop, till we fully receive a reply. int result = 0; @@ -39,7 +42,7 @@ TAO_Wait_On_Reactor::wait (ACE_Time_Value *max_wait_time, // If we got our reply, no need to run the event loop any // further. - if (!rd.keep_waiting ()) + if (!rd.keep_waiting (leader_follower)) { break; } @@ -61,7 +64,7 @@ TAO_Wait_On_Reactor::wait (ACE_Time_Value *max_wait_time, // Otherwise, keep going... } - if (result == -1 || rd.error_detected ()) + if (result == -1 || rd.error_detected (leader_follower)) { return -1; } @@ -69,7 +72,7 @@ TAO_Wait_On_Reactor::wait (ACE_Time_Value *max_wait_time, // Return an error if there was a problem receiving the reply. if (max_wait_time != 0) { - if (rd.successful () && *max_wait_time == ACE_Time_Value::zero) + if (rd.successful (leader_follower) && *max_wait_time == ACE_Time_Value::zero) { result = -1; errno = ETIME; @@ -79,7 +82,7 @@ TAO_Wait_On_Reactor::wait (ACE_Time_Value *max_wait_time, { result = 0; - if (rd.error_detected ()) + if (rd.error_detected (leader_follower)) { result = -1; } diff --git a/TAO/tao/Wait_On_Read.cpp b/TAO/tao/Wait_On_Read.cpp index 43176403909..f2cc92134e3 100644 --- a/TAO/tao/Wait_On_Read.cpp +++ b/TAO/tao/Wait_On_Read.cpp @@ -81,8 +81,10 @@ TAO_Wait_On_Read::wait (ACE_Time_Value * max_wait_time, // method. TAO::ORB_Countdown_Time countdown (max_wait_time); - rd.state_changed (TAO_LF_Event::LFS_ACTIVE, - this->transport_->orb_core ()->leader_follower ()); + TAO_Leader_Follower &leader_follower = + this->transport_->orb_core ()->leader_follower (); + + rd.state_changed (TAO_LF_Event::LFS_ACTIVE, leader_follower); // Do the same sort of looping that is done in other wait // strategies. @@ -94,7 +96,7 @@ TAO_Wait_On_Read::wait (ACE_Time_Value * max_wait_time, // If we got our reply, no need to run the loop any // further. - if (!rd.keep_waiting ()) + if (!rd.keep_waiting (leader_follower)) break; // @@ We are not checking for timeouts here... @@ -104,12 +106,12 @@ TAO_Wait_On_Read::wait (ACE_Time_Value * max_wait_time, break; } - if (rd.error_detected () == -1 || retval == -1) + if (rd.error_detected (leader_follower) || retval == -1) { this->transport_->close_connection (); } - if (rd.successful ()) + if (rd.successful (leader_follower)) { TAO_ORB_Core * const oc = this->transport_->orb_core (); @@ -147,7 +149,7 @@ TAO_Wait_On_Read::wait (ACE_Time_Value * max_wait_time, return 0; } - if (rd.error_detected ()) + if (rd.error_detected (leader_follower)) return -1; return 1; diff --git a/TAO/tests/Bug_3531b_Regression/server.cpp b/TAO/tests/Bug_3531b_Regression/server.cpp index a2d9c7714a6..635ab73a75e 100644 --- a/TAO/tests/Bug_3531b_Regression/server.cpp +++ b/TAO/tests/Bug_3531b_Regression/server.cpp @@ -251,22 +251,21 @@ public: this->state_changed (TAO_LF_Event::LFS_SUCCESS, lf); } - virtual bool successful (void) const +protected: + virtual bool successful_i (void) const { return this->state_ == TAO_LF_Event::LFS_SUCCESS; } - virtual bool error_detected (void) const + virtual bool error_detected_i (void) const { return (this->state_ == TAO_LF_Event::LFS_FAILURE || this->state_ == TAO_LF_Event::LFS_TIMEOUT || this->state_ == TAO_LF_Event::LFS_CONNECTION_CLOSED); } -protected: virtual void state_changed_i (int new_state) { this->state_ = new_state; - return; } virtual bool is_state_final (void) const |