From 7d86f39a230bbbefffa3031067f8196c86923d03 Mon Sep 17 00:00:00 2001 From: ed Date: Sun, 28 Sep 2025 22:17:30 +0000 Subject: [PATCH] uds-only mdns fix; closes #864 --- copyparty/multicast.py | 5 ++++- copyparty/tcpsrv.py | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/copyparty/multicast.py b/copyparty/multicast.py index ea2f223e..7459696e 100644 --- a/copyparty/multicast.py +++ b/copyparty/multicast.py @@ -96,7 +96,10 @@ class MCast(object): def create_servers(self) -> list[str]: bound: list[str] = [] netdevs = self.hub.tcpsrv.netdevs - ips = [x[0] for x in self.hub.tcpsrv.bound] + blist = self.hub.tcpsrv.bound + if self.args.http_no_tcp: + blist = self.hub.tcpsrv.seen_eps + ips = [x[0] for x in blist] if "::" in ips: ips = [x for x in ips if x != "::"] + list( diff --git a/copyparty/tcpsrv.py b/copyparty/tcpsrv.py index f92d5293..c44adf8e 100644 --- a/copyparty/tcpsrv.py +++ b/copyparty/tcpsrv.py @@ -59,6 +59,7 @@ class TcpSrv(object): self.stopping = False self.srv: list[socket.socket] = [] self.bound: list[tuple[str, int]] = [] + self.seen_eps: list[tuple[str, int]] = [] # also skipped by uds-only self.netdevs: dict[str, Netdev] = {} self.netlist = "" self.nsrv = 0 @@ -300,6 +301,7 @@ class TcpSrv(object): try: if tcp: if self.args.http_no_tcp: + self.seen_eps.append((ip, port)) return srv.bind((ip, port)) else: @@ -411,6 +413,7 @@ class TcpSrv(object): self.srv = srvs self.bound = bound + self.seen_eps = list(set(self.seen_eps + bound)) self.nsrv = len(srvs) self._distribute_netdevs()