From 3cb43a5e5f8917e90213850e33ad920694742bb6 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sat, 7 Mar 2020 18:56:15 -0500 Subject: [PATCH] Fix hole punch parsing with no port. If the port is the default port we won't include the :port part of the server address. In this case we must assume the default port. This should fix clients being unable to connect to servers when they run on the default port and require hole punch assistance. --- chocolate-master | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chocolate-master b/chocolate-master index 0b627e9..e5173da 100755 --- a/chocolate-master +++ b/chocolate-master @@ -382,7 +382,10 @@ class MasterServer: # a server that we have registered. _, server_addr_str = read_string(data) self.log_output(addr, "Hole punch request for %r" % server_addr_str) - a, p = server_addr_str.split(":", 1) + if ":" in server_addr_str: + a, p = server_addr_str.split(":", 1) + else: + a, p = server_addr_str, 2342 server_addr = (a, int(p)) if server_addr not in self.servers: