Repository: qpid-dispatch Updated Branches: refs/heads/tross-DISPATCH-179-1 7ec750b25 -> 620d779a5
DISPATCH_179 - Accept senders to unknown addresses; Don't issue credit to senders if there are no receivers; Disconnect linkage from PN->QDR on detach. Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/620d779a Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/620d779a Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/620d779a Branch: refs/heads/tross-DISPATCH-179-1 Commit: 620d779a528252a7bd3a252a42679fe8d26644d1 Parents: 7ec750b Author: Ted Ross <[email protected]> Authored: Fri Mar 18 09:07:37 2016 -0400 Committer: Ted Ross <[email protected]> Committed: Fri Mar 18 09:07:37 2016 -0400 ---------------------------------------------------------------------- src/router_core/connections.c | 9 +++++++-- src/router_node.c | 6 ++++++ 2 files changed, 13 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/620d779a/src/router_core/connections.c ---------------------------------------------------------------------- diff --git a/src/router_core/connections.c b/src/router_core/connections.c index f76311f..8ecd633 100644 --- a/src/router_core/connections.c +++ b/src/router_core/connections.c @@ -886,7 +886,7 @@ static void qdr_link_inbound_first_attach_CT(qdr_core_t *core, qdr_action_t *act // This link has a target address // bool link_route; - qdr_address_t *addr = qdr_lookup_terminus_address_CT(core, dir, target, false, false, &link_route); + qdr_address_t *addr = qdr_lookup_terminus_address_CT(core, dir, target, true, false, &link_route); if (!addr) { // // No route to this destination, reject the link @@ -915,7 +915,12 @@ static void qdr_link_inbound_first_attach_CT(qdr_core_t *core, qdr_action_t *act link->owning_addr = addr; qdr_add_link_ref(&addr->inlinks, link, QDR_LINK_LIST_CLASS_ADDRESS); qdr_link_outbound_second_attach_CT(core, link, source, target); - qdr_link_issue_credit_CT(core, link, link->capacity); + + // + // Issue the initial credit only if there are destinations for the address. + // + if (DEQ_SIZE(addr->subscriptions) || DEQ_SIZE(addr->rlinks) || qd_bitmask_cardinality(addr->rnodes)) + qdr_link_issue_credit_CT(core, link, link->capacity); } } break; http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/620d779a/src/router_node.c ---------------------------------------------------------------------- diff --git a/src/router_node.c b/src/router_node.c index 3a9b8af..b374cd7 100644 --- a/src/router_node.c +++ b/src/router_node.c @@ -447,6 +447,12 @@ static int router_link_detach_handler(void* context, qd_link_t *link, qd_detach_ if (!error && dt == QD_LOST) error = qdr_error("qd:routed-link-lost", "Connectivity to the peer container was lost"); qdr_link_detach(rlink, dt, error); + + // + // This is the last event for this link that we will send into the core. Remove the + // core linkage. Note that the core->qd linkage is still in place. + // + qd_link_set_context(link, 0); } return 0; --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
