linux 6.1 fixed the 6.0 bugs; remove workarounds

This commit is contained in:
ed 2023-01-16 20:44:57 +00:00
parent 18942ed066
commit 5bb9f56247
2 changed files with 0 additions and 17 deletions

View file

@ -2,7 +2,6 @@
from __future__ import print_function, unicode_literals from __future__ import print_function, unicode_literals
import base64 import base64
import errno
import math import math
import os import os
import socket import socket
@ -287,16 +286,6 @@ class HttpSrv(object):
if self.stopping: if self.stopping:
break break
if (
ex.errno == errno.EINVAL
and ip == "0.0.0.0"
and ("::", port) in self.bound
):
t = "accept({}): {} -- probably due to dualstack; terminating ({}, {})"
self.log(self.name, t.format(fno, ex, ip, port), c=6)
srv_sck.close()
return
self.log(self.name, "accept({}): {}".format(fno, ex), c=6) self.log(self.name, "accept({}): {}".format(fno, ex), c=6)
time.sleep(0.02) time.sleep(0.02)
continue continue

View file

@ -1,7 +1,6 @@
# coding: utf-8 # coding: utf-8
from __future__ import print_function, unicode_literals from __future__ import print_function, unicode_literals
import errno
import os import os
import re import re
import socket import socket
@ -224,11 +223,6 @@ class TcpSrv(object):
try: try:
srv.bind((ip, port)) srv.bind((ip, port))
sport = srv.getsockname()[1]
if port != sport:
# linux 6.0.16 lets you bind a port which is in use
# except it just gives you a random port instead
raise OSError(errno.EADDRINUSE, "")
self.srv.append(srv) self.srv.append(srv)
except (OSError, socket.error) as ex: except (OSError, socket.error) as ex:
if ex.errno in E_ADDR_IN_USE: if ex.errno in E_ADDR_IN_USE: