mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
fix ssdp on dualstack
This commit is contained in:
parent
8a7135cf41
commit
6222ddd720
|
@ -75,6 +75,7 @@ class SSDPr(object):
|
||||||
|
|
||||||
c = html_escape
|
c = html_escape
|
||||||
sip, sport = hc.s.getsockname()[:2]
|
sip, sport = hc.s.getsockname()[:2]
|
||||||
|
sip = sip.replace("::ffff:", "")
|
||||||
proto = "https" if self.args.https_only else "http"
|
proto = "https" if self.args.https_only else "http"
|
||||||
ubase = "{}://{}:{}".format(proto, sip, sport)
|
ubase = "{}://{}:{}".format(proto, sip, sport)
|
||||||
zsl = self.args.zsl
|
zsl = self.args.zsl
|
||||||
|
@ -160,7 +161,7 @@ class SSDPd(MCast):
|
||||||
|
|
||||||
self.rxc.add(buf)
|
self.rxc.add(buf)
|
||||||
if not buf.startswith(b"M-SEARCH * HTTP/1."):
|
if not buf.startswith(b"M-SEARCH * HTTP/1."):
|
||||||
raise Exception("not an ssdp message")
|
return
|
||||||
|
|
||||||
if not self.ptn_st.search(buf):
|
if not self.ptn_st.search(buf):
|
||||||
return
|
return
|
||||||
|
@ -184,7 +185,8 @@ BOOTID.UPNP.ORG: 0
|
||||||
CONFIGID.UPNP.ORG: 1
|
CONFIGID.UPNP.ORG: 1
|
||||||
|
|
||||||
"""
|
"""
|
||||||
zs = zs.format(formatdate(usegmt=True), srv.ip, srv.hport, self.args.zsid)
|
v4 = srv.ip.replace("::ffff:", "")
|
||||||
|
zs = zs.format(formatdate(usegmt=True), v4, srv.hport, self.args.zsid)
|
||||||
zb = zs[1:].replace("\n", "\r\n").encode("utf-8", "replace")
|
zb = zs[1:].replace("\n", "\r\n").encode("utf-8", "replace")
|
||||||
srv.sck.sendto(zb, addr[:2])
|
srv.sck.sendto(zb, addr[:2])
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue