From 36e9a5d57d43300b4693572eb0740f72065d90e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Gallou=C3=ABt?= Date: Wed, 24 Jan 2018 16:29:51 +0000 Subject: [PATCH] Use mud_add_path() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adrien Gallouët --- mud | 2 +- src/main.c | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/mud b/mud index a6555c8..7c90d54 160000 --- a/mud +++ b/mud @@ -1 +1 @@ -Subproject commit a6555c8ab14bf5c59bbeb9e4ac2ce134e640c379 +Subproject commit 7c90d54b911f677c7e95554f748a918e6304e6e7 diff --git a/src/main.c b/src/main.c index 4df7bb2..747c3b9 100644 --- a/src/main.c +++ b/src/main.c @@ -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; - } } }