Merge e4388246e3 into b925f785ed
This commit is contained in:
commit
99b9f07dae
|
|
@ -537,6 +537,12 @@ class WebSockifyServer():
|
||||||
# Close open files
|
# Close open files
|
||||||
maxfd = resource.getrlimit(resource.RLIMIT_NOFILE)[1]
|
maxfd = resource.getrlimit(resource.RLIMIT_NOFILE)[1]
|
||||||
if maxfd == resource.RLIM_INFINITY: maxfd = 256
|
if maxfd == resource.RLIM_INFINITY: maxfd = 256
|
||||||
|
# Since Systemd 256~rc3-3, maxfd could be
|
||||||
|
# *really* big, and therefore, the below code
|
||||||
|
# could take too much resources. This somehow
|
||||||
|
# attemps to limit this.
|
||||||
|
if maxfd > 4096:
|
||||||
|
maxfd = 4096
|
||||||
for fd in reversed(range(maxfd)):
|
for fd in reversed(range(maxfd)):
|
||||||
try:
|
try:
|
||||||
if fd not in keepfd:
|
if fd not in keepfd:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue