summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2012-01-20 15:21:37 +0000
committerAlan Conway <aconway@apache.org>2012-01-20 15:21:37 +0000
commit1a08c4097f7e18251f21ed0ea2a7660b24dface6 (patch)
tree186d143089d17d57d8c63079978c6d578285707c /cpp/src
parent649b2af2edb6a9feeca6e7880b5bbc5450d944be (diff)
downloadqpid-python-1a08c4097f7e18251f21ed0ea2a7660b24dface6.tar.gz
Revert "QPID-3352: Fix test for failed session to avoid confusion with as yet uninitialised session"
This reverts commit r1233083. It caused a test failure run_federation_tests: federation.FederationTests.test_pull_from_queue_recovery git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1233949 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/qpid/amqp_0_10/SessionHandler.cpp6
-rw-r--r--cpp/src/qpid/amqp_0_10/SessionHandler.h4
-rw-r--r--cpp/src/qpid/broker/Bridge.cpp5
-rw-r--r--cpp/src/qpid/broker/Bridge.h2
-rw-r--r--cpp/src/qpid/broker/Link.cpp2
5 files changed, 7 insertions, 12 deletions
diff --git a/cpp/src/qpid/amqp_0_10/SessionHandler.cpp b/cpp/src/qpid/amqp_0_10/SessionHandler.cpp
index e60b7739d8..5eedafc77b 100644
--- a/cpp/src/qpid/amqp_0_10/SessionHandler.cpp
+++ b/cpp/src/qpid/amqp_0_10/SessionHandler.cpp
@@ -42,7 +42,7 @@ void SessionHandler::checkAttached() {
SessionHandler::SessionHandler(FrameHandler* out, ChannelId ch)
: channel(ch, out), peer(channel),
awaitingDetached(false),
- sendReady(), receiveReady(), hasFailed(false) {}
+ sendReady(), receiveReady() {}
SessionHandler::~SessionHandler() {}
@@ -192,7 +192,6 @@ void SessionHandler::detached(const std::string& /*name*/, uint8_t code) {
awaitingDetached = false;
if (code != session::DETACH_CODE_NORMAL) {
sendReady = receiveReady = false;
- hasFailed = true;
channelException(convert(code), "session.detached from peer.");
} else {
handleDetach();
@@ -331,9 +330,6 @@ void SessionHandler::sendFlush() {
bool SessionHandler::ready() const {
return sendReady && receiveReady;
}
-bool SessionHandler::failed() const {
- return hasFailed;
-}
}} // namespace qpid::broker
diff --git a/cpp/src/qpid/amqp_0_10/SessionHandler.h b/cpp/src/qpid/amqp_0_10/SessionHandler.h
index d0e10b9908..8b072fa05c 100644
--- a/cpp/src/qpid/amqp_0_10/SessionHandler.h
+++ b/cpp/src/qpid/amqp_0_10/SessionHandler.h
@@ -67,8 +67,6 @@ class QPID_COMMON_CLASS_EXTERN SessionHandler : public framing::AMQP_AllOperatio
/** True if the handler is ready to send and receive */
QPID_COMMON_EXTERN bool ready() const;
- /** True if the session has failed with an execution exception */
- QPID_COMMON_EXTERN bool failed() const;
// Protocol methods
QPID_COMMON_EXTERN void attach(const std::string& name, bool force);
@@ -113,7 +111,7 @@ class QPID_COMMON_CLASS_EXTERN SessionHandler : public framing::AMQP_AllOperatio
framing::AMQP_AllProxy::Session peer;
std::string name;
bool awaitingDetached;
- bool sendReady, receiveReady, hasFailed;
+ bool sendReady, receiveReady;
};
}} // namespace qpid::amqp_0_10
diff --git a/cpp/src/qpid/broker/Bridge.cpp b/cpp/src/qpid/broker/Bridge.cpp
index 12c2194381..c709606c17 100644
--- a/cpp/src/qpid/broker/Bridge.cpp
+++ b/cpp/src/qpid/broker/Bridge.cpp
@@ -164,9 +164,10 @@ void Bridge::destroy()
listener(this);
}
-bool Bridge::hasSessionFailed() const
+bool Bridge::isSessionReady() const
{
- return conn->getChannel(id).failed();
+ SessionHandler& sessionHandler = conn->getChannel(id);
+ return sessionHandler.ready();
}
void Bridge::setPersistenceId(uint64_t pId) const
diff --git a/cpp/src/qpid/broker/Bridge.h b/cpp/src/qpid/broker/Bridge.h
index d8062760fc..8b4559a871 100644
--- a/cpp/src/qpid/broker/Bridge.h
+++ b/cpp/src/qpid/broker/Bridge.h
@@ -59,7 +59,7 @@ public:
void destroy();
bool isDurable() { return args.i_durable; }
- bool hasSessionFailed() const;
+ bool isSessionReady() const;
management::ManagementObject* GetManagementObject() const;
management::Manageable::status_t ManagementMethod(uint32_t methodId,
diff --git a/cpp/src/qpid/broker/Link.cpp b/cpp/src/qpid/broker/Link.cpp
index a27cb7c5ac..0bc7d8f47b 100644
--- a/cpp/src/qpid/broker/Link.cpp
+++ b/cpp/src/qpid/broker/Link.cpp
@@ -251,7 +251,7 @@ void Link::ioThreadProcessing()
// check for bridge session errors and recover
if (!active.empty()) {
Bridges::iterator removed = std::remove_if(
- active.begin(), active.end(), boost::bind(&Bridge::hasSessionFailed, _1));
+ active.begin(), active.end(), !boost::bind(&Bridge::isSessionReady, _1));
for (Bridges::iterator i = removed; i != active.end(); ++i) {
Bridge::shared_ptr bridge = *i;
bridge->closed();