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/10/23 17:58:40 UTC
qpid-dispatch git commit: DISPATCH-1152 - Automatically send second
detach if there is no on_first_detach handler. Added label string in
descriptor to aid debugging.
Repository: qpid-dispatch
Updated Branches:
refs/heads/master 0a66246e5 -> 267207d2b
DISPATCH-1152 - Automatically send second detach if there is no on_first_detach handler. Added label string in descriptor to aid debugging.
Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/267207d2
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/267207d2
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/267207d2
Branch: refs/heads/master
Commit: 267207d2b73f1133a0ed16cac6c3c9e845019a85
Parents: 0a66246
Author: Ted Ross <tr...@redhat.com>
Authored: Tue Oct 23 13:55:37 2018 -0400
Committer: Ted Ross <tr...@redhat.com>
Committed: Tue Oct 23 13:55:37 2018 -0400
----------------------------------------------------------------------
src/router_core/core_link_endpoint.c | 5 ++++-
src/router_core/core_link_endpoint.h | 1 +
src/router_core/modules/edge_router/addr_proxy.c | 1 +
src/router_core/modules/test_hooks/core_test_hooks.c | 2 +-
4 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/267207d2/src/router_core/core_link_endpoint.c
----------------------------------------------------------------------
diff --git a/src/router_core/core_link_endpoint.c b/src/router_core/core_link_endpoint.c
index 01df2c5..fad5c1b 100644
--- a/src/router_core/core_link_endpoint.c
+++ b/src/router_core/core_link_endpoint.c
@@ -200,7 +200,10 @@ void qdrc_endpoint_do_flow_CT(qdr_core_t *core, qdrc_endpoint_t *ep, int credit,
void qdrc_endpoint_do_detach_CT(qdr_core_t *core, qdrc_endpoint_t *ep, qdr_error_t *error)
{
if (ep->link->detach_count == 1) {
- ep->desc->on_first_detach(ep->link_context, error);
+ if (!!ep->desc->on_first_detach)
+ ep->desc->on_first_detach(ep->link_context, error);
+ else
+ qdr_link_outbound_detach_CT(core, ep->link, 0, QDR_CONDITION_NONE, true);
} else {
if (!!ep->desc->on_second_detach)
ep->desc->on_second_detach(ep->link_context, error);
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/267207d2/src/router_core/core_link_endpoint.h
----------------------------------------------------------------------
diff --git a/src/router_core/core_link_endpoint.h b/src/router_core/core_link_endpoint.h
index ab4e54f..34d3d46 100644
--- a/src/router_core/core_link_endpoint.h
+++ b/src/router_core/core_link_endpoint.h
@@ -127,6 +127,7 @@ typedef void (*qdrc_cleanup_t) (void *link_context);
typedef struct qdrc_endpoint_desc_t {
+ const char *label;
qdrc_first_attach_t on_first_attach;
qdrc_second_attach_t on_second_attach;
qdrc_flow_t on_flow;
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/267207d2/src/router_core/modules/edge_router/addr_proxy.c
----------------------------------------------------------------------
diff --git a/src/router_core/modules/edge_router/addr_proxy.c b/src/router_core/modules/edge_router/addr_proxy.c
index 96accaf..3859091 100644
--- a/src/router_core/modules/edge_router/addr_proxy.c
+++ b/src/router_core/modules/edge_router/addr_proxy.c
@@ -365,6 +365,7 @@ qcm_edge_addr_proxy_t *qcm_edge_addr_proxy(qdr_core_t *core)
ZERO(ap);
ap->core = core;
+ ap->endpoint_descriptor.label = "Edge Address Proxy";
ap->endpoint_descriptor.on_second_attach = on_second_attach;
ap->endpoint_descriptor.on_transfer = on_transfer;
ap->endpoint_descriptor.on_cleanup = on_cleanup;
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/267207d2/src/router_core/modules/test_hooks/core_test_hooks.c
----------------------------------------------------------------------
diff --git a/src/router_core/modules/test_hooks/core_test_hooks.c b/src/router_core/modules/test_hooks/core_test_hooks.c
index 0b1f65a..d173117 100644
--- a/src/router_core/modules/test_hooks/core_test_hooks.c
+++ b/src/router_core/modules/test_hooks/core_test_hooks.c
@@ -379,7 +379,7 @@ static void on_cleanup(void *link_context)
}
-static qdrc_endpoint_desc_t descriptor = {on_first_attach, on_second_attach, on_flow, on_update,
+static qdrc_endpoint_desc_t descriptor = {"Core Test Hooks", on_first_attach, on_second_attach, on_flow, on_update,
on_transfer, on_first_detach, on_second_detach, on_cleanup};
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org