1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

mqtt: do not show username if not provided

This commit is contained in:
Steffen Vogel 2018-05-24 15:50:43 +02:00
parent acee6a5bed
commit fb0547a163

View file

@ -302,14 +302,17 @@ char * mqtt_print(struct node *n)
char *buf = NULL;
strcatf(&buf, "format=%s, host=%s, port=%d, username=%s, keepalive=%s, ssl=%s", plugin_name(m->format),
strcatf(&buf, "format=%s, host=%s, port=%d, keepalive=%s, ssl=%s", plugin_name(m->format),
m->host,
m->port,
m->username,
m->keepalive ? "yes" : "no",
m->ssl.enabled ? "yes" : "no"
);
/* Only show if not default */
if (m->username)
strcatf(&buf, ", username=%s", m->username);
if (m->publish)
strcatf(&buf, ", publish=%s", m->publish);