You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by gs...@apache.org on 2021/04/16 12:49:27 UTC

[qpid-dispatch] branch main updated: DISPATCH-2050: propagate section-number and section-offset back to sender

This is an automated email from the ASF dual-hosted git repository.

gsim pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git


The following commit(s) were added to refs/heads/main by this push:
     new 1f4b9fb  DISPATCH-2050: propagate section-number and section-offset back to sender
1f4b9fb is described below

commit 1f4b9fba18ddfc04ab6d50fabcaf2c03aba4670a
Author: Gordon Sim <gs...@redhat.com>
AuthorDate: Thu Apr 15 19:55:08 2021 +0100

    DISPATCH-2050: propagate section-number and section-offset back to sender
---
 include/qpid/dispatch/delivery_state.h |  5 +++++
 src/router_core/delivery.c             |  2 +-
 src/router_node.c                      | 15 +++++++++++++--
 3 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/include/qpid/dispatch/delivery_state.h b/include/qpid/dispatch/delivery_state.h
index 078a09e..ec73f8c 100644
--- a/include/qpid/dispatch/delivery_state.h
+++ b/include/qpid/dispatch/delivery_state.h
@@ -20,6 +20,7 @@
  */
 
 #include <stdbool.h>
+#include <inttypes.h>
 
 /**
  * AMQP 1.0 defines a delivery-state type property.  Delivery-state is passed
@@ -32,6 +33,10 @@
 
 typedef struct {
 
+    //RECEIVED - see section 3.4.1
+    uint32_t  section_number;
+    uint64_t  section_offset;
+
     // REJECTED - see section 3.4.3
     struct qdr_error_t *error;
 
diff --git a/src/router_core/delivery.c b/src/router_core/delivery.c
index 830c64f..0ddd1d5 100644
--- a/src/router_core/delivery.c
+++ b/src/router_core/delivery.c
@@ -719,7 +719,7 @@ static void qdr_delivery_anycast_update_CT(qdr_core_t *core, qdr_delivery_t *dlv
     // unlinked.  It shall not be freed until the connection-side thread
     // settles the PN delivery.
     //
-    if (new_disp != dlv->remote_disposition) {
+    if (new_disp != dlv->remote_disposition || new_disp == PN_RECEIVED) {
         //
         // Remote disposition has changed, propagate the change to the peer
         // delivery local disposition.
diff --git a/src/router_node.c b/src/router_node.c
index ab0d442..dab2c1b 100644
--- a/src/router_node.c
+++ b/src/router_node.c
@@ -138,7 +138,13 @@ static qd_delivery_state_t *qd_delivery_read_remote_state(pn_delivery_t *pnd)
     uint64_t            outcome = pn_delivery_remote_state(pnd);
     if (pnd) {
         switch (outcome) {
-        case PN_RECEIVED:
+        case PN_RECEIVED: {
+            pn_disposition_t *disp = pn_delivery_remote(pnd);
+            dstate = qd_delivery_state();
+            dstate->section_number = pn_disposition_get_section_number(disp);
+            dstate->section_offset = pn_disposition_get_section_offset(disp);
+            break;
+        }
         case PN_ACCEPTED:
         case PN_RELEASED:
             // no associated state (that we care about)
@@ -197,7 +203,12 @@ static void qd_delivery_write_local_state(pn_delivery_t *pnd, uint64_t outcome,
 {
     if (pnd && dstate) {
         switch (outcome) {
-        case PN_RECEIVED:
+        case PN_RECEIVED: {
+            pn_disposition_t *ldisp = pn_delivery_local(pnd);
+            pn_disposition_set_section_number(ldisp, dstate->section_number);
+            pn_disposition_set_section_offset(ldisp, dstate->section_offset);
+            break;
+        }
         case PN_ACCEPTED:
         case PN_RELEASED:
             // no associated state (that we care about)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org