summaryrefslogtreecommitdiff
path: root/qpid/cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2012-11-23 16:56:43 +0000
committerGordon Sim <gsim@apache.org>2012-11-23 16:56:43 +0000
commit65d087a7063a631f7c0b8ec7e8b8d5b7b097aa7e (patch)
tree86fc02da8b8dc7df52272ca53f3ad37991c4d4bc /qpid/cpp
parentf94640c4ffcc1ba51973958d225f6762fd2d0074 (diff)
downloadqpid-python-65d087a7063a631f7c0b8ec7e8b8d5b7b097aa7e.tar.gz
QPID-4459: settle sent messages once they have been accepted by peer
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1412960 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp')
-rw-r--r--qpid/cpp/src/qpid/messaging/amqp/SenderContext.cpp6
-rw-r--r--qpid/cpp/src/qpid/messaging/amqp/SenderContext.h1
2 files changed, 6 insertions, 1 deletions
diff --git a/qpid/cpp/src/qpid/messaging/amqp/SenderContext.cpp b/qpid/cpp/src/qpid/messaging/amqp/SenderContext.cpp
index 9dc7c25121..96c4437b89 100644
--- a/qpid/cpp/src/qpid/messaging/amqp/SenderContext.cpp
+++ b/qpid/cpp/src/qpid/messaging/amqp/SenderContext.cpp
@@ -95,6 +95,7 @@ uint32_t SenderContext::processUnsettled()
{
//remove accepted messages from front of deque
while (!deliveries.empty() && deliveries.front().accepted()) {
+ deliveries.front().settle();
deliveries.pop_front();
}
return deliveries.size();
@@ -336,7 +337,10 @@ bool SenderContext::Delivery::accepted()
{
return pn_delivery_remote_state(token) == PN_ACCEPTED;
}
-
+void SenderContext::Delivery::settle()
+{
+ pn_delivery_settle(token);
+}
void SenderContext::configure() const
{
configure(pn_link_target(sender));
diff --git a/qpid/cpp/src/qpid/messaging/amqp/SenderContext.h b/qpid/cpp/src/qpid/messaging/amqp/SenderContext.h
index 366a3f1e79..3595379e70 100644
--- a/qpid/cpp/src/qpid/messaging/amqp/SenderContext.h
+++ b/qpid/cpp/src/qpid/messaging/amqp/SenderContext.h
@@ -53,6 +53,7 @@ class SenderContext
void encode(const qpid::messaging::MessageImpl& message, const qpid::messaging::Address&);
void send(pn_link_t*);
bool accepted();
+ void settle();
private:
int32_t id;
pn_delivery_t* token;