summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/cluster/ErrorCheck.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2009-06-18 21:25:00 +0000
committerAlan Conway <aconway@apache.org>2009-06-18 21:25:00 +0000
commitfdb23707352b96986daf36db3b47538a307a2888 (patch)
treeba4f703fb4741e769e1a5c90ba3d363502961181 /cpp/src/qpid/cluster/ErrorCheck.cpp
parentd3ba25a6c0ad0b8bce0482694152bcaed206af7b (diff)
downloadqpid-python-fdb23707352b96986daf36db3b47538a307a2888.tar.gz
Make error-check a cluster-connection control rather than a cluster control.
Fixes bug if an error occurs during update. As cluster controls, error-checks were being processed out of sequence with the connection data they referred to. Making them connection controls ensures they are processed in the proper order. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@786294 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/cluster/ErrorCheck.cpp')
-rw-r--r--cpp/src/qpid/cluster/ErrorCheck.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/cpp/src/qpid/cluster/ErrorCheck.cpp b/cpp/src/qpid/cluster/ErrorCheck.cpp
index 87a7bb914b..9c2ba9c61a 100644
--- a/cpp/src/qpid/cluster/ErrorCheck.cpp
+++ b/cpp/src/qpid/cluster/ErrorCheck.cpp
@@ -22,7 +22,7 @@
#include "EventFrame.h"
#include "ClusterMap.h"
#include "Cluster.h"
-#include "qpid/framing/ClusterErrorCheckBody.h"
+#include "qpid/framing/ClusterConnectionErrorCheckBody.h"
#include "qpid/framing/ClusterConfigChangeBody.h"
#include "qpid/log/Statement.h"
@@ -33,7 +33,7 @@ namespace cluster {
using namespace std;
using namespace framing;
-using namespace framing::cluster;
+using namespace framing::cluster_connection;
ErrorCheck::ErrorCheck(Cluster& c)
: cluster(c), mcast(c.getMulticast()), frameSeq(0), type(ERROR_TYPE_NONE), connection(0)
@@ -55,14 +55,16 @@ void ErrorCheck::error(Connection& c, ErrorType t, uint64_t seq, const MemberSet
connection = &c;
QPID_LOG(debug, cluster << (type == ERROR_TYPE_SESSION ? " Session" : " Connection")
<< " error " << frameSeq << " unresolved: " << unresolved);
- mcast.mcastControl(ClusterErrorCheckBody(ProtocolVersion(), type, frameSeq), cluster.getId());
+ mcast.mcastControl(
+ ClusterConnectionErrorCheckBody(ProtocolVersion(), type, frameSeq), c.getId());
}
void ErrorCheck::delivered(const EventFrame& e) {
if (isUnresolved()) {
- const ClusterErrorCheckBody* errorCheck = 0;
+ const ClusterConnectionErrorCheckBody* errorCheck = 0;
if (e.frame.getBody())
- errorCheck = dynamic_cast<const ClusterErrorCheckBody*>(e.frame.getMethod());
+ errorCheck = dynamic_cast<const ClusterConnectionErrorCheckBody*>(
+ e.frame.getMethod());
if (errorCheck && errorCheck->getFrameSeq() == frameSeq) { // Same error
if (errorCheck->getType() < type) { // my error is worse than his
QPID_LOG(critical, cluster << " Error " << frameSeq << " did not occur on " << e.getMemberId());