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 | b5497c2df7463138efd8a3e9a5b3277067a8f131 (patch) | |
tree | 658d4b8b74565d8d7b89c5b2a533a7c0b057a70c /cpp | |
parent | a8c38e0a0c3bbaa3e83c1ae1ebf4b41620a06797 (diff) | |
download | qpid-python-b5497c2df7463138efd8a3e9a5b3277067a8f131.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/qpid@1677016 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/src/qpid/messaging/amqp/ConnectionContext.cpp | 1 | ||||
-rw-r--r-- | cpp/src/qpid/messaging/amqp/SessionContext.cpp | 8 |
2 files changed, 6 insertions, 3 deletions
diff --git a/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp b/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp index 586c8a87d6..9d9f186f5c 100644 --- a/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp +++ b/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/cpp/src/qpid/messaging/amqp/SessionContext.cpp b/cpp/src/qpid/messaging/amqp/SessionContext.cpp index 2b82ffc377..92bdea7dbc 100644 --- a/cpp/src/qpid/messaging/amqp/SessionContext.cpp +++ b/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; } |