From 6304f2ebf3f2d4c95f2848a24242520e83e69a59 Mon Sep 17 00:00:00 2001 From: coryan Date: Wed, 29 Apr 2009 00:09:34 +0000 Subject: Wed Apr 29 00:12:29 UTC 2009 Carlos O'Ryan --- TAO/ChangeLog | 28 +++++++++++++ TAO/tao/Transport.cpp | 5 +++ TAO/tao/Transport.h | 6 +-- TAO/tests/Bug_3647_Regression/Backend_Impl.cpp | 6 +-- TAO/tests/Bug_3647_Regression/Backend_Impl.h | 37 ++++++++++++++++++ TAO/tests/Bug_3647_Regression/Backend_Impl.hpp | 42 -------------------- TAO/tests/Bug_3647_Regression/Middle_Impl.cpp | 5 +-- TAO/tests/Bug_3647_Regression/Middle_Impl.h | 46 ++++++++++++++++++++++ TAO/tests/Bug_3647_Regression/Middle_Impl.hpp | 50 ------------------------ TAO/tests/Bug_3647_Regression/Throw_Spec.h | 12 ------ TAO/tests/Bug_3647_Regression/backend_server.cpp | 2 +- TAO/tests/Bug_3647_Regression/middle_server.cpp | 2 +- 12 files changed, 123 insertions(+), 118 deletions(-) create mode 100644 TAO/tests/Bug_3647_Regression/Backend_Impl.h delete mode 100644 TAO/tests/Bug_3647_Regression/Backend_Impl.hpp create mode 100644 TAO/tests/Bug_3647_Regression/Middle_Impl.h delete mode 100644 TAO/tests/Bug_3647_Regression/Middle_Impl.hpp delete mode 100644 TAO/tests/Bug_3647_Regression/Throw_Spec.h diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 568e377d302..d7100ca802f 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,31 @@ +Wed Apr 29 00:12:29 UTC 2009 Carlos O'Ryan + + * tao/Transport.h: + * tao/Transport.cpp: + Restore the ACE_Countdown_Time object in drain_queue_helper(). + I removed it because I thought there were no side effects and it + was not needed, but after Johnny W asked, I realised it was + indeed important. + The header changes are required because the Drain_Constraints + object needs a non-const ACE_Time_Value* parameter now. + + * tests/Bug_3647_Regression/Backend_Impl.cpp: + * tests/Bug_3647_Regression/backend_server.cpp: + * tests/Bug_3647_Regression/Backend_Impl.hpp: + * tests/Bug_3647_Regression/Backend_Impl.h: + * tests/Bug_3647_Regression/Middle_Impl.cpp: + * tests/Bug_3647_Regression/Throw_Spec.h: + * tests/Bug_3647_Regression/Middle_Impl.hpp: + * tests/Bug_3647_Regression/middle_server.cpp: + * tests/Bug_3647_Regression/Middle_Impl.h: + I used a hacky macro to compile this code with both + TAO-1.5.1 (need throw specs) and TAO-1.6.9 (cannot have throw + specs) + I also changed the .hpp files to .h to be less consistent with + the .cpp files, but more consistent with the rest of ACE+TAO. + Thanks to Johnny to point out the ugliness before it reached the + main branch. + Sat Apr 25 11:31:50 UTC 2009 Carlos O'Ryan * tao/Transport.h: diff --git a/TAO/tao/Transport.cpp b/TAO/tao/Transport.cpp index 2d1716e32b6..d450945a54a 100644 --- a/TAO/tao/Transport.cpp +++ b/TAO/tao/Transport.cpp @@ -925,6 +925,11 @@ int TAO_Transport::drain_queue_helper (int &iovcnt, iovec iov[], TAO::Transport::Drain_Constraints const & dc) { + // As a side-effect, this decrements the timeout() pointed-to value by + // the time used in this function. That might be important as there are + // potentially long running system calls invoked from here. + ACE_Countdown_Time countdown(dc.timeout()); + size_t byte_count = 0; // ... send the message ... diff --git a/TAO/tao/Transport.h b/TAO/tao/Transport.h index 689b52ef7ee..c3e7f7059a3 100644 --- a/TAO/tao/Transport.h +++ b/TAO/tao/Transport.h @@ -114,7 +114,7 @@ namespace TAO /// Constructor Drain_Constraints( - ACE_Time_Value const * timeout, + ACE_Time_Value * timeout, bool block_on_io) : timeout_(timeout) , block_on_io_(block_on_io) @@ -134,13 +134,13 @@ namespace TAO * The maximum time to block on I/O operations (or nested loops) based * on the current timeout policies. */ - ACE_Time_Value const * timeout() const + ACE_Time_Value * timeout() const { return timeout_; } private: - ACE_Time_Value const * timeout_; + ACE_Time_Value * timeout_; bool block_on_io_; }; } diff --git a/TAO/tests/Bug_3647_Regression/Backend_Impl.cpp b/TAO/tests/Bug_3647_Regression/Backend_Impl.cpp index 435f8a505ee..213f90b907f 100644 --- a/TAO/tests/Bug_3647_Regression/Backend_Impl.cpp +++ b/TAO/tests/Bug_3647_Regression/Backend_Impl.cpp @@ -1,4 +1,4 @@ -#include "Backend_Impl.hpp" +#include "Backend_Impl.h" #include "ace/OS.h" Bug_3647_Regression::Backend_Impl:: @@ -16,7 +16,6 @@ Bug_3647_Regression::Backend_Impl:: void Bug_3647_Regression::Backend_Impl:: startup_test() - THROW_SPEC (CORBA::SystemException) { if (verbose_) { @@ -27,7 +26,6 @@ startup_test() void Bug_3647_Regression::Backend_Impl:: ping(Bug_3647_Regression::Payload const & p) - THROW_SPEC (CORBA::SystemException) { if (verbose_) { @@ -39,7 +37,6 @@ ping(Bug_3647_Regression::Payload const & p) void Bug_3647_Regression::Backend_Impl:: freeze(CORBA::ULong seconds) - THROW_SPEC (CORBA::SystemException) { if (verbose_) { @@ -59,7 +56,6 @@ freeze(CORBA::ULong seconds) void Bug_3647_Regression::Backend_Impl:: shutdown() - THROW_SPEC (CORBA::SystemException) { if (verbose_) { diff --git a/TAO/tests/Bug_3647_Regression/Backend_Impl.h b/TAO/tests/Bug_3647_Regression/Backend_Impl.h new file mode 100644 index 00000000000..efd8569082e --- /dev/null +++ b/TAO/tests/Bug_3647_Regression/Backend_Impl.h @@ -0,0 +1,37 @@ +#ifndef Bug_3647_Regression_Backend_Impl_h +#define Bug_3647_Regression_Backend_Impl_h + +#include "TestS.h" + +namespace Bug_3647_Regression +{ + +/** + * @class Backend + * + * Implement the Bug_3647_Regression::Backend interface + * + */ +class Backend_Impl : public POA_Bug_3647_Regression::Backend +{ +public: + Backend_Impl(CORBA::ORB_ptr orb, bool verbose); + virtual ~Backend_Impl(); + + virtual void startup_test(); + virtual void ping(Bug_3647_Regression::Payload const & the_payload); + virtual void freeze(CORBA::ULong seconds); + + virtual void shutdown(); + +private: + /// Keep a reference to the ORB so we can shutdown the application. + CORBA::ORB_var orb_; + + /// Use this flag to decide if the program should produce any output. + bool verbose_; +}; + +} // namespace Bug_3647_Regression + +#endif // Bug_3647_Regression_Backend_h diff --git a/TAO/tests/Bug_3647_Regression/Backend_Impl.hpp b/TAO/tests/Bug_3647_Regression/Backend_Impl.hpp deleted file mode 100644 index fb0dddc35c9..00000000000 --- a/TAO/tests/Bug_3647_Regression/Backend_Impl.hpp +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef Bug_3647_Regression_Backend_Impl_hpp -#define Bug_3647_Regression_Backend_Impl_hpp - -#include "TestS.h" -#include "Throw_Spec.h" - -namespace Bug_3647_Regression -{ - -/** - * @class Backend - * - * Implement the Bug_3647_Regression::Backend interface - * - */ -class Backend_Impl : public POA_Bug_3647_Regression::Backend -{ -public: - Backend_Impl(CORBA::ORB_ptr orb, bool verbose); - virtual ~Backend_Impl(); - - virtual void startup_test() - THROW_SPEC (CORBA::SystemException); - virtual void ping(Bug_3647_Regression::Payload const & the_payload) - THROW_SPEC (CORBA::SystemException); - virtual void freeze(CORBA::ULong seconds) - THROW_SPEC (CORBA::SystemException); - - virtual void shutdown() - THROW_SPEC (CORBA::SystemException); - -private: - /// Keep a reference to the ORB so we can shutdown the application. - CORBA::ORB_var orb_; - - /// Use this flag to decide if the program should produce any output. - bool verbose_; -}; - -} // namespace Bug_3647_Regression - -#endif // Bug_3647_Regression_Backend_hpp diff --git a/TAO/tests/Bug_3647_Regression/Middle_Impl.cpp b/TAO/tests/Bug_3647_Regression/Middle_Impl.cpp index dcd08d9c068..ca62d2563af 100644 --- a/TAO/tests/Bug_3647_Regression/Middle_Impl.cpp +++ b/TAO/tests/Bug_3647_Regression/Middle_Impl.cpp @@ -1,4 +1,4 @@ -#include "Middle_Impl.hpp" +#include "Middle_Impl.h" Bug_3647_Regression::Middle_Impl:: Middle_Impl( @@ -21,7 +21,6 @@ Bug_3647_Regression::Middle_Impl:: void Bug_3647_Regression::Middle_Impl:: startup_test() - THROW_SPEC (CORBA::SystemException) { if (verbose_) { @@ -46,7 +45,6 @@ startup_test() void Bug_3647_Regression::Middle_Impl:: ping() - THROW_SPEC (CORBA::SystemException) { if (verbose_) { @@ -77,7 +75,6 @@ ping() void Bug_3647_Regression::Middle_Impl:: shutdown() - THROW_SPEC (CORBA::SystemException) { if (verbose_) { diff --git a/TAO/tests/Bug_3647_Regression/Middle_Impl.h b/TAO/tests/Bug_3647_Regression/Middle_Impl.h new file mode 100644 index 00000000000..0435f8a3b7d --- /dev/null +++ b/TAO/tests/Bug_3647_Regression/Middle_Impl.h @@ -0,0 +1,46 @@ +#ifndef Bug_3647_Regression_Middle_Impl_h +#define Bug_3647_Regression_Middle_Impl_h + +#include "TestS.h" + +namespace Bug_3647_Regression +{ + +/** + * @class Middle + * + * Implement the Bug_3647_Regression::Middle interface + * + */ +class Middle_Impl : public POA_Bug_3647_Regression::Middle +{ +public: + Middle_Impl( + Backend_ptr backend, + CORBA::ORB_ptr orb, + bool verbose, + long timeout); + virtual ~Middle_Impl(); + + virtual void startup_test(); + virtual void ping(); + + virtual void shutdown(); + +private: + /// Keep a reference to the backend so we can call it, shutdown, etc. + Backend_var backend_; + + /// Keep a reference to the ORB so we can shutdown the application. + CORBA::ORB_var orb_; + + /// Use this flag to decide if the program should produce any output. + bool verbose_; + + /// Control the freeze time based on the timeout time + long timeout_; +}; + +} // namespace Bug_3647_Regression + +#endif // Bug_3647_Regression_Middle_hpp diff --git a/TAO/tests/Bug_3647_Regression/Middle_Impl.hpp b/TAO/tests/Bug_3647_Regression/Middle_Impl.hpp deleted file mode 100644 index 659a4818723..00000000000 --- a/TAO/tests/Bug_3647_Regression/Middle_Impl.hpp +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef Bug_3647_Regression_Middle_Impl_hpp -#define Bug_3647_Regression_Middle_Impl_hpp - -#include "TestS.h" -#include "Throw_Spec.h" - -namespace Bug_3647_Regression -{ - -/** - * @class Middle - * - * Implement the Bug_3647_Regression::Middle interface - * - */ -class Middle_Impl : public POA_Bug_3647_Regression::Middle -{ -public: - Middle_Impl( - Backend_ptr backend, - CORBA::ORB_ptr orb, - bool verbose, - long timeout); - virtual ~Middle_Impl(); - - virtual void startup_test() - THROW_SPEC (CORBA::SystemException); - virtual void ping() - THROW_SPEC (CORBA::SystemException); - - virtual void shutdown() - THROW_SPEC (CORBA::SystemException); - -private: - /// Keep a reference to the backend so we can call it, shutdown, etc. - Backend_var backend_; - - /// Keep a reference to the ORB so we can shutdown the application. - CORBA::ORB_var orb_; - - /// Use this flag to decide if the program should produce any output. - bool verbose_; - - /// Control the freeze time based on the timeout time - long timeout_; -}; - -} // namespace Bug_3647_Regression - -#endif // Bug_3647_Regression_Middle_hpp diff --git a/TAO/tests/Bug_3647_Regression/Throw_Spec.h b/TAO/tests/Bug_3647_Regression/Throw_Spec.h deleted file mode 100644 index 0f29359d965..00000000000 --- a/TAO/tests/Bug_3647_Regression/Throw_Spec.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef Bug_3647_Regression_Throw_Spec_hpp -#define Bug_3647_Regression_Throw_Spec_hpp - -#include "ace/Version.h" - -#if ACE_MINOR_VERSION >= 6 -# define THROW_SPEC(X) /**/ -#else -# define THROW_SPEC(X) throw(X) -#endif // ACE_MINOR_VERSION - -#endif // Bug_3647_Regression_Throw_Spec_hpp diff --git a/TAO/tests/Bug_3647_Regression/backend_server.cpp b/TAO/tests/Bug_3647_Regression/backend_server.cpp index 1c7b2ae073d..65e03ea57c6 100644 --- a/TAO/tests/Bug_3647_Regression/backend_server.cpp +++ b/TAO/tests/Bug_3647_Regression/backend_server.cpp @@ -1,6 +1,6 @@ // $Id$ -#include "Backend_Impl.hpp" +#include "Backend_Impl.h" #include "tao/Strategies/advanced_resource.h" diff --git a/TAO/tests/Bug_3647_Regression/middle_server.cpp b/TAO/tests/Bug_3647_Regression/middle_server.cpp index 8ac8a0c8a5f..a60585ab7eb 100644 --- a/TAO/tests/Bug_3647_Regression/middle_server.cpp +++ b/TAO/tests/Bug_3647_Regression/middle_server.cpp @@ -1,6 +1,6 @@ // $Id$ -#include "Middle_Impl.hpp" +#include "Middle_Impl.h" #include "tao/Utils/PolicyList_Destroyer.h" #include "tao/Utils/Servant_Var.h" -- cgit v1.2.1