summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2012-11-28 14:13:28 +0000
committerGordon Sim <gsim@apache.org>2012-11-28 14:13:28 +0000
commit8b8226a06e72cdf414a7ddb14421ea7111d4c0a5 (patch)
tree97c2a8dd9ec263d371451dcdafc7c4f12517bf17
parent5a4cc61cf5895271b46d34b089cd04bf93885590 (diff)
downloadqpid-python-8b8226a06e72cdf414a7ddb14421ea7111d4c0a5.tar.gz
QPID-4459: settle sent messages once they have been accepted by peer
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/0.20@1414707 13f79535-47bb-0310-9956-ffa450edef68
-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;