Github user ganeshmurthy commented on a diff in the pull request:
https://github.com/apache/qpid-dispatch/pull/252#discussion_r165080053
--- Diff: src/router_core/route_control.c ---
@@ -266,6 +266,117 @@ static void qdr_auto_link_deactivate_CT(qdr_core_t
*core, qdr_auto_link_t *al, q
}
+static void qdr_router_add_link_route_pattern_CT(qdr_core_t *core,
qdr_connection_t *conn, const char *pattern, qd_direction_t dir)
+{
+ if (*pattern == '\0')
+ return;
+
+ char *addr_hash = qdr_link_route_pattern_to_address(pattern,
dir);
+ qd_iterator_t *iter = qd_iterator_string(addr_hash + 1,
ITER_VIEW_ADDRESS_HASH);
+ qdr_address_t *addr = 0;
+
+ qd_iterator_annotate_prefix(iter, addr_hash[0]);
+ if (conn->tenant_space)
+ qd_iterator_annotate_space(iter, conn->tenant_space,
conn->tenant_space_len);
+
+ qd_hash_retrieve(core->addr_hash, iter, (void*) &addr);
+ if (!addr) {
+ addr = qdr_address_CT(core, QD_TREATMENT_LINK_BALANCED);
+ DEQ_INSERT_TAIL(core->addrs, addr);
+ qd_hash_insert(core->addr_hash, iter, addr, &addr->hash_handle);
+ qdr_link_route_map_pattern_CT(core, iter, addr);
+ }
+
+ qdr_add_address_ref(&conn->addr_refs, addr);
+ qdr_add_connection_ref(&addr->conns, conn);
+ if (DEQ_SIZE(addr->conns) == 1) {
+ char *hash_key = (char*) qd_iterator_copy(iter);
+ qdr_post_mobile_added_CT(core, hash_key);
+ free(hash_key);
+ }
+
+ free(addr_hash);
+}
+
+
+static void qdr_route_use_connection_properties_CT(qdr_core_t *core,
qdr_connection_t *conn)
+{
+ pn_data_t *p = conn->connection_info->connection_properties;
+
+ //
+ // If there are no connection properties, we have nothing to do.
+ //
+ if (!p)
+ return;
+
+ pn_data_rewind(p);
+ pn_data_next(p);
+
+ //
+ // If the connection properties are not a map, there's no point in
continuing.
+ //
+ if (pn_data_type(p) != PN_MAP)
+ return;
+
+ pn_data_enter(p);
+ pn_data_next(p);
+
+ //
+ // Work across the map looking for keys that are relevant for route
modification.
+ //
+ while (pn_data_type(p) == PN_SYMBOL) {
--- End diff --
After a little bit thought, I do feel that these link routes must show up
when you do a qdstat --linkRoutes. Maybe these link routes can have a boolean
flag on them called "dynamic" which can be set to true for these link routes
which will distinguish them from the pre-configured link routes which will have
that flag set to false.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]