From f2c1d03d8e268375de00352a1228a5669b016b61 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 9 Aug 2020 12:08:16 -0700 Subject: [PATCH] Don't bother doing any connection testing if no ports were specified --- src/ConnectionTester.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ConnectionTester.c b/src/ConnectionTester.c index fef74ee..975147e 100644 --- a/src/ConnectionTester.c +++ b/src/ConnectionTester.c @@ -89,6 +89,11 @@ unsigned int LiTestClientConnectivity(const char* testServer, unsigned short ref testPortFlags &= VALID_PORT_FLAG_MASK; failingPortFlags = testPortFlags; + // If no ports were specified, just return 0 + if (testPortFlags == 0) { + return 0; + } + // Initialize sockets array to -1 memset(sockets, 0xFF, sizeof(sockets));