summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/qpid/client/ClientChannel.cpp2
-rw-r--r--cpp/src/qpid/client/Response.h3
2 files changed, 4 insertions, 1 deletions
diff --git a/cpp/src/qpid/client/ClientChannel.cpp b/cpp/src/qpid/client/ClientChannel.cpp
index 9eca2903cc..424ff97ea1 100644
--- a/cpp/src/qpid/client/ClientChannel.cpp
+++ b/cpp/src/qpid/client/ClientChannel.cpp
@@ -220,7 +220,9 @@ void Channel::cancel(const std::string& tag, bool synch) {
bool Channel::get(Message& msg, const Queue& queue, AckMode ackMode) {
AMQMethodBody::shared_ptr request(new BasicGetBody(version, 0, queue.getName(), ackMode));
+
Response response = session->send(request, true);
+ session->flush();
if (response.isA<BasicGetEmptyBody>()) {
return false;
} else {
diff --git a/cpp/src/qpid/client/Response.h b/cpp/src/qpid/client/Response.h
index f44cd72783..425d78e7cd 100644
--- a/cpp/src/qpid/client/Response.h
+++ b/cpp/src/qpid/client/Response.h
@@ -43,7 +43,8 @@ public:
}
template <class T> bool isA()
{
- return future->getResponse()->isA<T>();
+ framing::AMQMethodBody::shared_ptr response(future->getResponse());
+ return response && response->isA<T>();
}
void sync()