Skip to content

Commit cf57e42

Browse files
committed
Fixes handling of autoLinks with empty address through management API
Fixes #1833.
1 parent 3ebe152 commit cf57e42

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/router_core/agent_config_auto_link.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,8 @@ static void qdr_config_auto_link_insert_column_CT(qdr_auto_link_t *al, int col,
8585
break;
8686

8787
case QDR_CONFIG_AUTO_LINK_ADDRESS:
88-
key = (const char*) qd_hash_key_by_handle(al->addr->hash_handle);
89-
if (key && key[0] == 'M')
90-
qd_compose_insert_string(body, &key[1]);
88+
if (al->internal_addr)
89+
qd_compose_insert_string(body, al->internal_addr);
9190
else
9291
qd_compose_insert_null(body);
9392
break;
@@ -340,8 +339,7 @@ void qdra_config_auto_link_delete_CT(qdr_core_t *core,
340339
al = qdr_auto_link_config_find_by_name_CT(core, name);
341340

342341
if (al) {
343-
const char *address = (char*) qd_hash_key_by_handle(al->addr->hash_handle);
344-
qd_log(LOG_CONN_MGR, QD_LOG_INFO, "Deleted autolink with address=%s, direction=%s and %s=%s", address, al->dir==QD_INCOMING ? "in":"out", al->connection ? "connection": "containerId", al->connection? al->connection: al->container_id);
342+
qd_log(LOG_CONN_MGR, QD_LOG_INFO, "Deleted autolink with address=%s, external_address=%s, direction=%s and %s=%s", al->internal_addr, al->external_addr, al->dir==QD_INCOMING ? "in":"out", al->connection ? "connection": "containerId", al->connection? al->connection: al->container_id);
345343
qdr_route_del_auto_link_CT(core, al);
346344
query->status = QD_AMQP_NO_CONTENT;
347345
} else

tests/system_tests_autolinks.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,12 @@ def test_12_autolink_attach_anonymous(self):
447447
test.run()
448448
self.assertIsNone(test.error)
449449

450+
def test_13_autolink_manage(self):
451+
cmd = "CREATE --type=autoLink name=manual-link direction=in externalAddress=manual.ext"
452+
self.run_skmanage(cmd)
453+
cmd = "DELETE --type=autoLink --name=manual-link"
454+
self.run_skmanage(cmd)
455+
450456

451457
class AutolinkAttachTestWithListenerName(MessagingHandler):
452458
def __init__(self, address, node_addr):

0 commit comments

Comments
 (0)