Use mud_add_path()

Signed-off-by: Adrien Gallouët <adrien@gallouet.fr>
This commit is contained in:
Adrien Gallouët
2018-01-24 16:29:51 +00:00
parent 0c3c2ca28b
commit 36e9a5d57d
2 changed files with 10 additions and 10 deletions

View File

@@ -335,9 +335,14 @@ main(int argc, char **argv)
}
if (gt.host && gt.port) {
if (mud_peer(mud, gt.host, gt.port)) {
perror("mud_peer");
return 1;
}
if (gt.bind.backup) {
if (mud_peer(mud, gt.bind.backup, gt.host, gt.port, 1)) {
perror("mud_peer (backup)");
if (mud_add_path(mud, gt.bind.backup, 1)) {
perror("mud_add_path (backup)");
return 1;
}
}
@@ -357,18 +362,13 @@ main(int argc, char **argv)
if (*p)
*p++ = 0;
if (mud_peer(mud, name, gt.host, gt.port, 0)) {
perror("mud_peer (bind)");
if (mud_add_path(mud, name, 0)) {
perror("mud_add_path");
return 1;
}
name = p;
}
} else {
if (mud_peer(mud, NULL, gt.host, gt.port, 0)) {
perror("mud_peer");
return 1;
}
}
}