From 5bb9f562476bb6c9e0ebde5bd37e056985692b4a Mon Sep 17 00:00:00 2001 From: ed Date: Mon, 16 Jan 2023 20:44:57 +0000 Subject: [PATCH] linux 6.1 fixed the 6.0 bugs; remove workarounds --- copyparty/httpsrv.py | 11 ----------- copyparty/tcpsrv.py | 6 ------ 2 files changed, 17 deletions(-) diff --git a/copyparty/httpsrv.py b/copyparty/httpsrv.py index 90352f1c..6cd7bd15 100644 --- a/copyparty/httpsrv.py +++ b/copyparty/httpsrv.py @@ -2,7 +2,6 @@ from __future__ import print_function, unicode_literals import base64 -import errno import math import os import socket @@ -287,16 +286,6 @@ class HttpSrv(object): if self.stopping: 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) time.sleep(0.02) continue diff --git a/copyparty/tcpsrv.py b/copyparty/tcpsrv.py index 507fa7c2..122ee6a8 100644 --- a/copyparty/tcpsrv.py +++ b/copyparty/tcpsrv.py @@ -1,7 +1,6 @@ # coding: utf-8 from __future__ import print_function, unicode_literals -import errno import os import re import socket @@ -224,11 +223,6 @@ class TcpSrv(object): try: 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) except (OSError, socket.error) as ex: if ex.errno in E_ADDR_IN_USE: