summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/cluster/Cluster.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2009-05-20 18:19:44 +0000
committerAlan Conway <aconway@apache.org>2009-05-20 18:19:44 +0000
commitb7b99eb789e893cbf0ff6bbf0b157d37d302f95f (patch)
treec18896a0f74f0b13c0b4d6f6a05e45d00a5b1ad9 /cpp/src/qpid/cluster/Cluster.cpp
parent2ee35df0444e52ba7e24d8817110adbeaacb9e52 (diff)
downloadqpid-python-b7b99eb789e893cbf0ff6bbf0b157d37d302f95f.tar.gz
Add missing null body check in ErrorCheck
Make error checking optional. This is temporary until all issues with it are worked out. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@776799 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/cluster/Cluster.cpp')
-rw-r--r--cpp/src/qpid/cluster/Cluster.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/cpp/src/qpid/cluster/Cluster.cpp b/cpp/src/qpid/cluster/Cluster.cpp
index 58ac4b91b3..082e5488e8 100644
--- a/cpp/src/qpid/cluster/Cluster.cpp
+++ b/cpp/src/qpid/cluster/Cluster.cpp
@@ -338,7 +338,8 @@ void Cluster::deliveredEvent(const Event& e) {
void Cluster::flagError(Connection& connection, ErrorCheck::ErrorType type) {
Mutex::ScopedLock l(lock);
- error.error(connection, type, map.getFrameSeq(), map.getMembers());
+ if (settings.checkErrors)
+ error.error(connection, type, map.getFrameSeq(), map.getMembers());
}
LATENCY_TRACK(sys::LatencyTracker<const AMQBody*> doOutputTracker("DoOutput");)
@@ -350,9 +351,14 @@ void Cluster::deliveredFrame(const EventFrame& e) {
LATENCY_TRACK(if (e.frame.getBody()->type() == CONTENT_BODY) doOutputTracker.start(e.frame.getBody()));
Mutex::ScopedLock l(lock);
// Process each frame through the error checker.
- error.delivered(e);
- while (error.canProcess()) // There is a frame ready to process.
- processFrame(error.getNext(), l);
+ if (settings.checkErrors) {
+ error.delivered(e);
+ while (error.canProcess()) // There is a frame ready to process.
+ processFrame(error.getNext(), l);
+ }
+ else {
+ processFrame(e, l);
+ }
}
LATENCY_TRACK(sys::LatencyStatistic processLatency("Process");)
@@ -707,7 +713,7 @@ std::ostream& operator<<(std::ostream& o, const Cluster& cluster) {
};
assert(sizeof(STATE)/sizeof(*STATE) == Cluster::LEFT+1);
o << cluster.self << "(" << STATE[cluster.state];
- if (cluster.error.isUnresolved()) o << "/error";
+ if (cluster.settings.checkErrors && cluster.error.isUnresolved()) o << "/error";
return o << ")";
}