qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject [5/7] qpid-dispatch git commit: DISPATCH-807: Remove delivery arg from delivery_handler interface
Date Fri, 15 Sep 2017 19:06:41 GMT
DISPATCH-807: Remove delivery arg from delivery_handler interface

Container delivery handler has a qd_link arg and from that the
pn_link and the current pn_delivery may be derived.


Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/e8b1c057
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/e8b1c057
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/e8b1c057

Branch: refs/heads/master
Commit: e8b1c057c3873e18c03d3922cb773817b72751dc
Parents: 51e2bf8
Author: Chuck Rolke <crolke@redhat.com>
Authored: Thu Sep 14 10:33:50 2017 -0400
Committer: Chuck Rolke <crolke@redhat.com>
Committed: Fri Sep 15 14:50:33 2017 -0400

----------------------------------------------------------------------
 include/qpid/dispatch/container.h | 7 ++++---
 src/container.c                   | 2 +-
 src/router_node.c                 | 6 +++++-
 3 files changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/e8b1c057/include/qpid/dispatch/container.h
----------------------------------------------------------------------
diff --git a/include/qpid/dispatch/container.h b/include/qpid/dispatch/container.h
index bcb079c..844c32d 100644
--- a/include/qpid/dispatch/container.h
+++ b/include/qpid/dispatch/container.h
@@ -70,7 +70,8 @@ typedef enum {
 typedef struct qd_node_t     qd_node_t;
 typedef struct qd_link_t     qd_link_t;
 
-typedef void (*qd_container_delivery_handler_t)    (void *node_context, qd_link_t *link,
pn_delivery_t *delivery);
+typedef void (*qd_container_delivery_handler_t)    (void *node_context, qd_link_t *link);
+typedef void (*qd_container_disposition_handler_t) (void *node_context, qd_link_t *link,
pn_delivery_t *pnd);
 typedef int  (*qd_container_link_handler_t)        (void *node_context, qd_link_t *link);
 typedef int  (*qd_container_link_detach_handler_t) (void *node_context, qd_link_t *link,
qd_detach_type_t dt);
 typedef void (*qd_container_node_handler_t)        (void *type_context, qd_node_t *node);
@@ -88,11 +89,11 @@ typedef struct {
      * @{
      */
 
-    /** Invoked when a new received delivery is avaliable for processing. */
+    /** Invoked when a new or existing received delivery is avaliable for processing. */
     qd_container_delivery_handler_t rx_handler;
 
     /** Invoked when an existing delivery changes disposition or settlement state. */
-    qd_container_delivery_handler_t disp_handler;
+    qd_container_disposition_handler_t disp_handler;
 
     /** Invoked when an attach for a new incoming link is received. */
     qd_container_link_handler_t incoming_handler;

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/e8b1c057/src/container.c
----------------------------------------------------------------------
diff --git a/src/container.c b/src/container.c
index 3c3bc49..a99ef35 100644
--- a/src/container.c
+++ b/src/container.c
@@ -172,7 +172,7 @@ static void do_receive(pn_delivery_t *pnd)
     if (link) {
         qd_node_t *node = link->node;
         if (node) {
-            node->ntype->rx_handler(node->context, link, pnd);
+            node->ntype->rx_handler(node->context, link);
             return;
         }
     }

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/e8b1c057/src/router_node.c
----------------------------------------------------------------------
diff --git a/src/router_node.c b/src/router_node.c
index 3ed4eac..6672751 100644
--- a/src/router_node.c
+++ b/src/router_node.c
@@ -191,10 +191,14 @@ static qd_iterator_t *router_annotate_message(qd_router_t   *router,
 /**
  * Inbound Delivery Handler
  */
-static void AMQP_rx_handler(void* context, qd_link_t *link, pn_delivery_t *pnd)
+static void AMQP_rx_handler(void* context, qd_link_t *link)
 {
     qd_router_t    *router       = (qd_router_t*) context;
     pn_link_t      *pn_link      = qd_link_pn(link);
+    assert(pn_link);
+    pn_delivery_t  *pnd          = pn_link_current(pn_link);
+    if (!pnd)
+        return;
     qdr_link_t     *rlink        = (qdr_link_t*) qd_link_get_context(link);
     qd_connection_t  *conn       = qd_link_connection(link);
     const qd_server_config_t *cf = qd_connection_config(conn);


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


Mime
View raw message