summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/framing/Proxy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/qpid/framing/Proxy.cpp')
-rw-r--r--cpp/src/qpid/framing/Proxy.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/cpp/src/qpid/framing/Proxy.cpp b/cpp/src/qpid/framing/Proxy.cpp
index 6b37fb368d..6c3724bcdb 100644
--- a/cpp/src/qpid/framing/Proxy.cpp
+++ b/cpp/src/qpid/framing/Proxy.cpp
@@ -18,15 +18,21 @@
#include "Proxy.h"
#include "AMQFrame.h"
+#include "AMQMethodBody.h"
+#include "qpid/log/Statement.h"
namespace qpid {
namespace framing {
-Proxy::Proxy(FrameHandler& h) : out(&h) {}
+Proxy::Proxy(FrameHandler& h) : out(&h), sync(false) {}
Proxy::~Proxy() {}
void Proxy::send(const AMQBody& b) {
+ if (sync) {
+ const AMQMethodBody* m = dynamic_cast<const AMQMethodBody*>(&b);
+ if (m) m->setSync(sync);
+ }
AMQFrame f(b);
out->handle(f);
}
@@ -39,4 +45,7 @@ FrameHandler& Proxy::getHandler() { return *out; }
void Proxy::setHandler(FrameHandler& f) { out=&f; }
+Proxy::ScopedSync::ScopedSync(Proxy& p) : proxy(p) { proxy.sync = true; }
+Proxy::ScopedSync::~ScopedSync() { proxy.sync = false; }
+
}} // namespace qpid::framing