You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by tr...@apache.org on 2018/12/19 17:36:45 UTC

[qpid-dispatch] branch master updated (94e484f -> 5bc6477)

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

tross pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git.


    from 94e484f  DISPATCH-1225: fill freed memory with a pattern for debugging
     new f1d7cf4  DISPATCH-1214 - Ensure that the delivery pointer isn't dereferenced after it is dec-ref'ed in case the dec-ref results in the freeing of the delivery.
     new 5bc6477  DISPATCH-1162 - Fixed typos in docs

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../user-guide/modules/network-topologies.adoc     | 20 +----
 src/router_core/transfer.c                         | 95 +++++++++++-----------
 2 files changed, 52 insertions(+), 63 deletions(-)


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


[qpid-dispatch] 01/02: DISPATCH-1214 - Ensure that the delivery pointer isn't dereferenced after it is dec-ref'ed in case the dec-ref results in the freeing of the delivery.

Posted by tr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit f1d7cf419a468967ccddef986ca9fba0ec92259a
Author: Ted Ross <tr...@redhat.com>
AuthorDate: Wed Dec 19 12:34:21 2018 -0500

    DISPATCH-1214 - Ensure that the delivery pointer isn't dereferenced after it is dec-ref'ed in case the dec-ref results in the freeing of the delivery.
---
 src/router_core/transfer.c | 95 +++++++++++++++++++++++-----------------------
 1 file changed, 48 insertions(+), 47 deletions(-)

diff --git a/src/router_core/transfer.c b/src/router_core/transfer.c
index 49c1442..f1d7203 100644
--- a/src/router_core/transfer.c
+++ b/src/router_core/transfer.c
@@ -1249,66 +1249,67 @@ static void qdr_deliver_continue_CT(qdr_core_t *core, qdr_action_t *action, bool
     qdr_delivery_t *in_dlv  = action->args.connection.delivery;
     bool more = action->args.connection.more;
 
-    // This decref is for the action reference
-    qdr_delivery_decref_CT(core, in_dlv, "qdr_deliver_continue_CT - remove from action");
-
     //
     // If it is already in the undelivered list, don't try to deliver this again.
     //
-    if (in_dlv->where == QDR_DELIVERY_IN_UNDELIVERED)
-        return;
+    if (in_dlv->where != QDR_DELIVERY_IN_UNDELIVERED) {
+        qdr_deliver_continue_peers_CT(core, in_dlv);
 
-    qdr_deliver_continue_peers_CT(core, in_dlv);
+        qd_message_t *msg = qdr_delivery_message(in_dlv);
 
-    qd_message_t *msg = qdr_delivery_message(in_dlv);
+        if (!more && !qd_message_is_discard(msg)) {
+            //
+            // The entire message has now been received. Check to see if there are in process subscriptions that need to
+            // receive this message. in process subscriptions, at this time, can deal only with full messages.
+            //
+            qdr_subscription_t *sub = DEQ_HEAD(in_dlv->subscriptions);
+            while (sub) {
+                DEQ_REMOVE_HEAD(in_dlv->subscriptions);
+                qdr_forward_on_message_CT(core, sub, in_dlv->link, in_dlv->msg);
+                sub = DEQ_HEAD(in_dlv->subscriptions);
+            }
 
-    if (!more && !qd_message_is_discard(msg)) {
-        //
-        // The entire message has now been received. Check to see if there are in process subscriptions that need to
-        // receive this message. in process subscriptions, at this time, can deal only with full messages.
-        //
-        qdr_subscription_t *sub = DEQ_HEAD(in_dlv->subscriptions);
-        while (sub) {
-            DEQ_REMOVE_HEAD(in_dlv->subscriptions);
-            qdr_forward_on_message_CT(core, sub, in_dlv->link, in_dlv->msg);
-            sub = DEQ_HEAD(in_dlv->subscriptions);
-        }
+            // This is a multicast delivery or if this is a presettled multi-frame unicast delivery.
+            if (in_dlv->multicast || in_dlv->settled) {
 
-        // This is a multicast delivery or if this is a presettled multi-frame unicast delivery.
-        if (in_dlv->multicast || in_dlv->settled) {
+                //
+                // If a delivery is settled but did not go into one of the lists, that means that it is going nowhere.
+                // We dont want to deal with such deliveries.
+                //
+                if (in_dlv->settled && in_dlv->where == QDR_DELIVERY_NOWHERE) {
+                    qdr_delivery_decref_CT(core, in_dlv, "qdr_deliver_continue_CT - remove from action 1");
+                    return;
+                }
 
-            //
-            // If a delivery is settled but did not go into one of the lists, that means that it is going nowhere.
-            // We dont want to deal with such deliveries.
-            //
-            if (in_dlv->settled && in_dlv->where == QDR_DELIVERY_NOWHERE)
-                return;
+                assert(in_dlv->where == QDR_DELIVERY_IN_SETTLED);
+                //
+                // The router will settle on behalf of the receiver in the case of multicast and send out settled
+                // deliveries to the receivers.
+                //
+                in_dlv->disposition = PN_ACCEPTED;
+                qdr_delivery_push_CT(core, in_dlv);
 
-            assert(in_dlv->where == QDR_DELIVERY_IN_SETTLED);
-            //
-            // The router will settle on behalf of the receiver in the case of multicast and send out settled
-            // deliveries to the receivers.
-            //
-            in_dlv->disposition = PN_ACCEPTED;
-            qdr_delivery_push_CT(core, in_dlv);
+                //
+                // The in_dlv has one or more peers. These peers will have to be unlinked.
+                //
+                qdr_delivery_t *peer = qdr_delivery_first_peer_CT(in_dlv);
+                qdr_delivery_t *next_peer = 0;
+                while (peer) {
+                    next_peer = qdr_delivery_next_peer_CT(in_dlv);
+                    qdr_delivery_unlink_peers_CT(core, in_dlv, peer);
+                    peer = next_peer;
+                }
 
-            //
-            // The in_dlv has one or more peers. These peers will have to be unlinked.
-            //
-            qdr_delivery_t *peer = qdr_delivery_first_peer_CT(in_dlv);
-            qdr_delivery_t *next_peer = 0;
-            while (peer) {
-                next_peer = qdr_delivery_next_peer_CT(in_dlv);
-                qdr_delivery_unlink_peers_CT(core, in_dlv, peer);
-                peer = next_peer;
+                // Remove the delivery from the settled list and decref the in_dlv.
+                in_dlv->where = QDR_DELIVERY_NOWHERE;
+                DEQ_REMOVE(in_dlv->link->settled, in_dlv);
+                qdr_delivery_decref_CT(core, in_dlv, "qdr_deliver_continue_CT - remove from settled list");
             }
-
-            // Remove the delivery from the settled list and decref the in_dlv.
-            in_dlv->where = QDR_DELIVERY_NOWHERE;
-            DEQ_REMOVE(in_dlv->link->settled, in_dlv);
-            qdr_delivery_decref_CT(core, in_dlv, "qdr_deliver_continue_CT - remove from settled list");
         }
     }
+
+    // This decref is for the action reference
+    qdr_delivery_decref_CT(core, in_dlv, "qdr_deliver_continue_CT - remove from action 2");
 }
 
 


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


[qpid-dispatch] 02/02: DISPATCH-1162 - Fixed typos in docs

Posted by tr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 5bc647719826f7be31e024a180d309e683287e6e
Author: Ted Ross <tr...@redhat.com>
AuthorDate: Wed Dec 19 12:36:24 2018 -0500

    DISPATCH-1162 - Fixed typos in docs
---
 .../books/user-guide/modules/network-topologies.adoc | 20 ++++----------------
 1 file changed, 4 insertions(+), 16 deletions(-)

diff --git a/docs/books/user-guide/modules/network-topologies.adoc b/docs/books/user-guide/modules/network-topologies.adoc
index aeab0ab..109300e 100644
--- a/docs/books/user-guide/modules/network-topologies.adoc
+++ b/docs/books/user-guide/modules/network-topologies.adoc
@@ -50,7 +50,7 @@ of the configuration:
 
 * `interior` - This mode is used for each router in the interior of a network
   of routers.  Interior routers are connected to each other using `connector`
-  and `listener` configurations in the `inter-router` role.  There is au upper
+  and `listener` configurations in the `inter-router` role.  There is an upper
   limit of 128 total interior routers in a network.  Interior routers that are
   connected together in an arbitrary topology automatically compute the lowest
   cost paths across the network.
@@ -104,11 +104,11 @@ equal participants in a bi-directional connection.  For the purposes of
 routing AMQP traffic across the network, the direction of connection
 establishment is not relevant.
 
-When establishing inter-router connections, the deployed must choose which
-router will be the listener and which will be the connector.  There should ne
+When establishing inter-router connections, the deployer must choose which
+router will be the listener and which will be the connector.  There should be
 only one connection between any pair of routers.  There is no need, and it is
 in fact undesirable, to create two connections in opposite directions between
-to routers.  Don't do it.
+two routers.  Don't do it.
 
 The selection of connector vs. listener is sometimes arbitrary because it
 doesn't matter.  In other cases, the direction may be important because of IP
@@ -125,15 +125,3 @@ to one or two central "hub" routers would most easily be set up with listeners
 on the hub and connectors on the spokes.  This way, new spoke routers may be
 added without changing the configuration of the hub.
 
-[id='network-topologies-examples-{context}']
-== Example Router Networks
-
-=== A Router Pair for Availability
-
-=== A Network for Multiple Cloud Sites
-
-=== A Network for Multiple Geographies
-
-=== Edge Routers Per-Server in a Data Center
-
-=== Edge Router for Inter-Process-Communication with an Uplink


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