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:
parent
acee6a5bed
commit
fb0547a163
1 changed files with 5 additions and 2 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue