DISPATCH-781 - Bugfix: Apply the flow heuristic only for mobile class addresses


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

Branch: refs/heads/tross-dispatch-781-1
Commit: 85a89965a09ae3ff4dce08ee35dd26b2510a4434
Parents: 645b2e6
Author: Ted Ross <tr...@redhat.com>
Authored: Thu Jun 1 16:14:27 2017 -0400
Committer: Ted Ross <tr...@redhat.com>
Committed: Thu Jun 1 16:14:27 2017 -0400

----------------------------------------------------------------------
 src/router_core/transfer.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/85a89965/src/router_core/transfer.c
----------------------------------------------------------------------
diff --git a/src/router_core/transfer.c b/src/router_core/transfer.c
index 9cf338a..d7e8d52 100644
--- a/src/router_core/transfer.c
+++ b/src/router_core/transfer.c
@@ -760,7 +760,7 @@ void qdr_link_issue_credit_CT(qdr_core_t *core, qdr_link_t 
*link, int credit, bo
     // If there is a credit deficit (i.e. the credit window shrank), then 
reduce the
     // credit by up to the deficit.
     //
-    if (link->credit_deficit > 0) {
+    if (link->link_type == QD_LINK_ENDPOINT && link->credit_deficit > 0) {
         if (link->credit_deficit > credit) {
             link->credit_deficit -= credit;
             credit = 0;
@@ -812,6 +812,9 @@ static void qdr_calculate_target_credit_CT(qdr_address_t 
*addr)
  */
 void qdr_addr_visit_inlinks_CT(qdr_core_t *core, qdr_address_t *addr)
 {
+    const char *key = (const char*) qd_hash_key_by_handle(addr->hash_handle);
+    bool is_mobile = (key && *key == 'M');
+
     //
     // Calculate the new target credit for the address.
     //
@@ -822,10 +825,10 @@ void qdr_addr_visit_inlinks_CT(qdr_core_t *core, 
qdr_address_t *addr)
         qdr_link_t *link      = ref->link;
         bool        from_zero = link->credit_window == 0;
 
-        if (DEQ_SIZE(addr->subscriptions) > 0) {
+        if (!is_mobile || DEQ_SIZE(addr->subscriptions) > 0) {
             //
-            // If the address has at least one in-process subscriber and the
-            // credit window is zero (first time through), simply issue the
+            // If the address has at least one in-process subscriber, or is 
not mobile,
+            // and the credit window is zero (first time through), simply 
issue the
             // link capacity.  This address will not follow the credit 
heuristic.
             //
             if (from_zero) {


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

Reply via email to