summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2010-11-12 13:22:31 +0000
committerGordon Sim <gsim@apache.org>2010-11-12 13:22:31 +0000
commitb0e8f2db7791bf2c08bb25673e44ec8362816cae (patch)
tree7ecb427407e6dbf03c5800faed6998560c8bcde1
parentafcd6866247e95e0795c74ff03109fd1118c8ecb (diff)
downloadqpid-python-b0e8f2db7791bf2c08bb25673e44ec8362816cae.tar.gz
QPID-2940: always request completions from broker on Session::acknowledge(), and always clean up any pending accept records at that time
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1034393 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--cpp/src/qpid/client/amqp0_10/SessionImpl.cpp4
-rw-r--r--cpp/src/qpid/messaging/Session.cpp2
2 files changed, 4 insertions, 2 deletions
diff --git a/cpp/src/qpid/client/amqp0_10/SessionImpl.cpp b/cpp/src/qpid/client/amqp0_10/SessionImpl.cpp
index 1086146b0d..6d98527627 100644
--- a/cpp/src/qpid/client/amqp0_10/SessionImpl.cpp
+++ b/cpp/src/qpid/client/amqp0_10/SessionImpl.cpp
@@ -97,7 +97,7 @@ void SessionImpl::acknowledge(bool sync_)
//message may be redelivered; i.e. the application cannot delete
//any state necessary for preventing reprocessing of the message
execute<Acknowledge>();
- if (sync_) sync(true);
+ sync(sync_);
}
void SessionImpl::reject(qpid::messaging::Message& m)
@@ -433,6 +433,8 @@ void SessionImpl::syncImpl(bool block)
{
if (block) session.sync();
else session.flush();
+ //cleanup unconfirmed accept records:
+ incoming.pendingAccept();
}
void SessionImpl::commitImpl()
diff --git a/cpp/src/qpid/messaging/Session.cpp b/cpp/src/qpid/messaging/Session.cpp
index f07fad434e..496953a8e5 100644
--- a/cpp/src/qpid/messaging/Session.cpp
+++ b/cpp/src/qpid/messaging/Session.cpp
@@ -39,7 +39,7 @@ Session& Session::operator=(const Session& s) { return PI::assign(*this, s); }
void Session::commit() { impl->commit(); }
void Session::rollback() { impl->rollback(); }
void Session::acknowledge(bool sync) { impl->acknowledge(sync); }
-void Session::acknowledge(Message& m, bool s) { impl->acknowledge(m); if (s) sync(true); }
+void Session::acknowledge(Message& m, bool s) { impl->acknowledge(m); sync(s); }
void Session::reject(Message& m) { impl->reject(m); }
void Session::release(Message& m) { impl->release(m); }
void Session::close() { impl->close(); }