mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
macos fixes
This commit is contained in:
parent
0f0f8d90c1
commit
14fa369fae
|
@ -1049,7 +1049,7 @@ def add_network(ap):
|
||||||
ap2.add_argument("--rp-loc", metavar="PATH", type=u, default="", help="if reverse-proxying on a location instead of a dedicated domain/subdomain, provide the base location here; example: [\033[32m/foo/bar\033[0m]")
|
ap2.add_argument("--rp-loc", metavar="PATH", type=u, default="", help="if reverse-proxying on a location instead of a dedicated domain/subdomain, provide the base location here; example: [\033[32m/foo/bar\033[0m]")
|
||||||
if ANYWIN:
|
if ANYWIN:
|
||||||
ap2.add_argument("--reuseaddr", action="store_true", help="set reuseaddr on listening sockets on windows; allows rapid restart of copyparty at the expense of being able to accidentally start multiple instances")
|
ap2.add_argument("--reuseaddr", action="store_true", help="set reuseaddr on listening sockets on windows; allows rapid restart of copyparty at the expense of being able to accidentally start multiple instances")
|
||||||
else:
|
elif not MACOS:
|
||||||
ap2.add_argument("--freebind", action="store_true", help="allow listening on IPs which do not yet exist, for example if the network interfaces haven't finished going up. Only makes sense for IPs other than '0.0.0.0', '127.0.0.1', '::', and '::1'. May require running as root (unless net.ipv6.ip_nonlocal_bind)")
|
ap2.add_argument("--freebind", action="store_true", help="allow listening on IPs which do not yet exist, for example if the network interfaces haven't finished going up. Only makes sense for IPs other than '0.0.0.0', '127.0.0.1', '::', and '::1'. May require running as root (unless net.ipv6.ip_nonlocal_bind)")
|
||||||
ap2.add_argument("--wr-h-eps", metavar="PATH", type=u, default="", help="write list of listening-on ip:port to textfile at \033[33mPATH\033[0m when http-servers have started")
|
ap2.add_argument("--wr-h-eps", metavar="PATH", type=u, default="", help="write list of listening-on ip:port to textfile at \033[33mPATH\033[0m when http-servers have started")
|
||||||
ap2.add_argument("--wr-h-aon", metavar="PATH", type=u, default="", help="write list of accessible-on ip:port to textfile at \033[33mPATH\033[0m when http-servers have started")
|
ap2.add_argument("--wr-h-aon", metavar="PATH", type=u, default="", help="write list of accessible-on ip:port to textfile at \033[33mPATH\033[0m when http-servers have started")
|
||||||
|
|
|
@ -45,6 +45,7 @@ from .util import (
|
||||||
APPLESAN_RE,
|
APPLESAN_RE,
|
||||||
BITNESS,
|
BITNESS,
|
||||||
DAV_ALLPROPS,
|
DAV_ALLPROPS,
|
||||||
|
E_SCK_WR,
|
||||||
FN_EMB,
|
FN_EMB,
|
||||||
HAVE_SQLITE3,
|
HAVE_SQLITE3,
|
||||||
HTTPCODE,
|
HTTPCODE,
|
||||||
|
@ -4365,7 +4366,7 @@ class HttpCli(object):
|
||||||
self.log("file deleted; disconnecting")
|
self.log("file deleted; disconnecting")
|
||||||
break
|
break
|
||||||
except IOError as ex:
|
except IOError as ex:
|
||||||
if ex.errno not in (errno.EPIPE, errno.ESHUTDOWN, errno.EBADFD):
|
if ex.errno not in E_SCK_WR:
|
||||||
raise
|
raise
|
||||||
finally:
|
finally:
|
||||||
if f:
|
if f:
|
||||||
|
|
|
@ -282,7 +282,7 @@ class TcpSrv(object):
|
||||||
except:
|
except:
|
||||||
pass # will create another ipv4 socket instead
|
pass # will create another ipv4 socket instead
|
||||||
|
|
||||||
if not ANYWIN and self.args.freebind:
|
if getattr(self.args, "freebind", False):
|
||||||
srv.setsockopt(socket.SOL_IP, socket.IP_FREEBIND, 1)
|
srv.setsockopt(socket.SOL_IP, socket.IP_FREEBIND, 1)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -105,6 +105,7 @@ def _ens(want: str) -> tuple[int, ...]:
|
||||||
# WSAENOTSOCK - no longer a socket
|
# WSAENOTSOCK - no longer a socket
|
||||||
# EUNATCH - can't assign requested address (wifi down)
|
# EUNATCH - can't assign requested address (wifi down)
|
||||||
E_SCK = _ens("ENOTCONN EUNATCH EBADF WSAENOTSOCK WSAECONNRESET")
|
E_SCK = _ens("ENOTCONN EUNATCH EBADF WSAENOTSOCK WSAECONNRESET")
|
||||||
|
E_SCK_WR = _ens("EPIPE ESHUTDOWN EBADFD")
|
||||||
E_ADDR_NOT_AVAIL = _ens("EADDRNOTAVAIL WSAEADDRNOTAVAIL")
|
E_ADDR_NOT_AVAIL = _ens("EADDRNOTAVAIL WSAEADDRNOTAVAIL")
|
||||||
E_ADDR_IN_USE = _ens("EADDRINUSE WSAEADDRINUSE")
|
E_ADDR_IN_USE = _ens("EADDRINUSE WSAEADDRINUSE")
|
||||||
E_ACCESS = _ens("EACCES WSAEACCES")
|
E_ACCESS = _ens("EACCES WSAEACCES")
|
||||||
|
|
Loading…
Reference in a new issue