diff options
author | Gordon Sim <gsim@apache.org> | 2015-04-30 15:42:28 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2015-04-30 15:42:28 +0000 |
commit | 9d5c1d00fbd34ee18416d2857ebe9e8234db78a9 (patch) | |
tree | 669c234984b7983994c419c44f9d3fe62fc52ac2 | |
parent | 5715d967f11f5ce684914d8b133683912e2af7bb (diff) | |
download | qpid-python-9d5c1d00fbd34ee18416d2857ebe9e8234db78a9.tar.gz |
QPID-6521: ensure messages received presettled by peer are settled locally; thanks to Alan Conway for the working patch!
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1677016 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp | 1 | ||||
-rw-r--r-- | qpid/cpp/src/qpid/messaging/amqp/SessionContext.cpp | 8 |
2 files changed, 6 insertions, 3 deletions
diff --git a/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp b/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp index 586c8a87d6..9d9f186f5c 100644 --- a/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp +++ b/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp @@ -307,7 +307,6 @@ bool ConnectionContext::get(boost::shared_ptr<SessionContext> ssn, boost::shared encoded->init(impl); impl.setEncoded(encoded); impl.setInternalId(ssn->record(current)); - pn_link_advance(lnk->receiver); if (lnk->capacity) { pn_link_flow(lnk->receiver, 1); if (lnk->wakeupToIssueCredit()) { diff --git a/qpid/cpp/src/qpid/messaging/amqp/SessionContext.cpp b/qpid/cpp/src/qpid/messaging/amqp/SessionContext.cpp index 2b82ffc377..92bdea7dbc 100644 --- a/qpid/cpp/src/qpid/messaging/amqp/SessionContext.cpp +++ b/qpid/cpp/src/qpid/messaging/amqp/SessionContext.cpp @@ -134,9 +134,13 @@ qpid::framing::SequenceNumber SessionContext::record(pn_delivery_t* delivery) { error.raise(); qpid::framing::SequenceNumber id = next++; - if (!pn_delivery_settled(delivery)) + if (!pn_delivery_settled(delivery)) { unacked[id] = delivery; - QPID_LOG(debug, "Recorded delivery " << id << " -> " << delivery); + QPID_LOG(debug, "Recorded delivery " << id << " -> " << delivery); + pn_link_advance(pn_delivery_link(delivery)); + } else { + pn_delivery_settle(delivery); // Automatically advances the link. + } return id; } |