summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/cluster/Event.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2009-07-01 21:58:40 +0000
committerAlan Conway <aconway@apache.org>2009-07-01 21:58:40 +0000
commit4ceab39ad4caa3e1769ead86291b8f4297488fd8 (patch)
tree83e0533ec3bcaa3c63e27daac8d1614ab6997141 /cpp/src/qpid/cluster/Event.cpp
parent205287377cf6d24b461ef336b268294f860862a3 (diff)
downloadqpid-python-4ceab39ad4caa3e1769ead86291b8f4297488fd8.tar.gz
Fix members joining cluster while cluster is handling client errors.
Completes the previous incomplete fix in r790163. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@790397 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/cluster/Event.cpp')
-rw-r--r--cpp/src/qpid/cluster/Event.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/cpp/src/qpid/cluster/Event.cpp b/cpp/src/qpid/cluster/Event.cpp
index 52ea84b02b..ae62994e88 100644
--- a/cpp/src/qpid/cluster/Event.cpp
+++ b/cpp/src/qpid/cluster/Event.cpp
@@ -113,11 +113,12 @@ Event::operator Buffer() const {
return Buffer(const_cast<char*>(getData()), getSize());
}
-AMQFrame Event::getFrame() const {
+const AMQFrame& Event::getFrame() const {
assert(type == CONTROL);
+ if (!frame.getBody()) {
Buffer buf(*this);
- AMQFrame frame;
QPID_ASSERT(frame.decode(buf));
+ }
return frame;
}
@@ -128,8 +129,17 @@ std::ostream& operator << (std::ostream& o, EventType t) {
}
std::ostream& operator << (std::ostream& o, const EventHeader& e) {
- o << "Event[" << e.getConnectionId() << " " << e.getType() << " " << e.getSize() << " bytes]";
- return o;
+ return o << "Event[" << e.getConnectionId() << " " << e.getType()
+ << " " << e.getSize() << " bytes]";
+}
+
+std::ostream& operator << (std::ostream& o, const Event& e) {
+ o << "Event[" << e.getConnectionId() << " ";
+ if (e.getType() == CONTROL)
+ o << e.getFrame();
+ else
+ o << " data " << e.getSize() << " bytes";
+ return o << "]";
}
}} // namespace qpid::cluster