uds-only mdns fix; closes #864

This commit is contained in:
ed 2025-09-28 22:17:30 +00:00
parent 456addf26f
commit 7d86f39a23
2 changed files with 7 additions and 1 deletions

View file

@ -96,7 +96,10 @@ class MCast(object):
def create_servers(self) -> list[str]: def create_servers(self) -> list[str]:
bound: list[str] = [] bound: list[str] = []
netdevs = self.hub.tcpsrv.netdevs 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: if "::" in ips:
ips = [x for x in ips if x != "::"] + list( ips = [x for x in ips if x != "::"] + list(

View file

@ -59,6 +59,7 @@ class TcpSrv(object):
self.stopping = False self.stopping = False
self.srv: list[socket.socket] = [] self.srv: list[socket.socket] = []
self.bound: list[tuple[str, int]] = [] self.bound: list[tuple[str, int]] = []
self.seen_eps: list[tuple[str, int]] = [] # also skipped by uds-only
self.netdevs: dict[str, Netdev] = {} self.netdevs: dict[str, Netdev] = {}
self.netlist = "" self.netlist = ""
self.nsrv = 0 self.nsrv = 0
@ -300,6 +301,7 @@ class TcpSrv(object):
try: try:
if tcp: if tcp:
if self.args.http_no_tcp: if self.args.http_no_tcp:
self.seen_eps.append((ip, port))
return return
srv.bind((ip, port)) srv.bind((ip, port))
else: else:
@ -411,6 +413,7 @@ class TcpSrv(object):
self.srv = srvs self.srv = srvs
self.bound = bound self.bound = bound
self.seen_eps = list(set(self.seen_eps + bound))
self.nsrv = len(srvs) self.nsrv = len(srvs)
self._distribute_netdevs() self._distribute_netdevs()