summaryrefslogtreecommitdiff
path: root/qpid/extras/dispatch/src/router_node.c
diff options
context:
space:
mode:
authorTed Ross <tross@apache.org>2013-10-11 15:14:12 +0000
committerTed Ross <tross@apache.org>2013-10-11 15:14:12 +0000
commit1b1c02486f1036d1e26a073361b6688ca48eaeb2 (patch)
treec7fb4d8ecdb9f594d8d9e3a3749c059e62a07863 /qpid/extras/dispatch/src/router_node.c
parent3fb57a88813f6fa7e8d8bb9c85a5383dbc7e2d95 (diff)
downloadqpid-python-1b1c02486f1036d1e26a073361b6688ca48eaeb2.tar.gz
QPID-5216
- Fixed bug that blocked routing of messages inbound from a client link - Changed trace to accept any initial header value git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1531328 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/extras/dispatch/src/router_node.c')
-rw-r--r--qpid/extras/dispatch/src/router_node.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/qpid/extras/dispatch/src/router_node.c b/qpid/extras/dispatch/src/router_node.c
index 4b13230687..414d920428 100644
--- a/qpid/extras/dispatch/src/router_node.c
+++ b/qpid/extras/dispatch/src/router_node.c
@@ -333,17 +333,19 @@ static dx_field_iterator_t *router_annotate_message(dx_router_t *router, dx_mess
//
// If there is a trace field, append this router's ID to the trace.
//
- if (trace && dx_parse_is_list(trace)) {
+ if (trace) {
dx_compose_insert_string(out_da, DX_DA_TRACE);
dx_compose_start_list(out_da);
- uint32_t idx = 0;
- dx_parsed_field_t *trace_item = dx_parse_sub_value(trace, idx);
- while (trace_item) {
- dx_field_iterator_t *iter = dx_parse_raw(trace_item);
- dx_compose_insert_string_iterator(out_da, iter);
- idx++;
- trace_item = dx_parse_sub_value(trace, idx);
+ if (dx_parse_is_list(trace)) {
+ uint32_t idx = 0;
+ dx_parsed_field_t *trace_item = dx_parse_sub_value(trace, idx);
+ while (trace_item) {
+ dx_field_iterator_t *iter = dx_parse_raw(trace_item);
+ dx_compose_insert_string_iterator(out_da, iter);
+ idx++;
+ trace_item = dx_parse_sub_value(trace, idx);
+ }
}
dx_compose_insert_string(out_da, direct_prefix);
@@ -366,6 +368,10 @@ static dx_field_iterator_t *router_annotate_message(dx_router_t *router, dx_mess
dx_message_set_delivery_annotations(msg, out_da);
dx_compose_free(out_da);
+ //
+ // Return the iterator to the ingress field _if_ it was present.
+ // If we added the ingress, return NULL.
+ //
return ingress_iter;
}
@@ -529,7 +535,8 @@ static void router_rx_handler(void* context, dx_link_t *link, dx_delivery_t *del
dx_router_ref_t *rref = DEQ_HEAD(origin_addr->rnodes);
origin = rref->router->mask_bit;
}
- }
+ } else
+ origin = 0;
//
// Forward to the next-hops for remote destinations.