From 99b2c70137fef05a5a18f439b9010ddba455f5cb Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Sat, 27 Jun 2020 15:18:45 +0200 Subject: Create a shared mc protocol implementation and use it in the proxy and cmd line tool --- minecctl/misc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'minecctl/misc.c') diff --git a/minecctl/misc.c b/minecctl/misc.c index bb33161..72eb03c 100644 --- a/minecctl/misc.c +++ b/minecctl/misc.c @@ -68,8 +68,13 @@ connect_any(struct list_head *addrs, bool may_fail) bool connected = false; int sfd; - if (list_empty(addrs)) - die("No address to connect to"); + /* FIXME: check callers and coordinate debug msg */ + if (list_empty(addrs)) { + if (may_fail) + return -1; + else + die("No address to connect to"); + } list_for_each_entry(saddr, addrs, list) { verbose("Attempting connection to %s", saddr->addrstr); -- cgit v1.2.3