mirror of
https://github.com/9001/copyparty.git
synced 2026-03-17 13:44:43 +10:00
replace magic numbers with errno.*
This commit is contained in:
@@ -35,6 +35,7 @@ from .util import (
|
||||
FHC,
|
||||
Garda,
|
||||
Magician,
|
||||
E_SCK,
|
||||
min_ex,
|
||||
shut_socket,
|
||||
spack,
|
||||
@@ -332,7 +333,7 @@ class HttpSrv(object):
|
||||
cli.run()
|
||||
|
||||
except (OSError, socket.error) as ex:
|
||||
if ex.errno not in [10038, 10054, 107, 57, 49, 9]:
|
||||
if ex.errno not in E_SCK:
|
||||
self.log(
|
||||
"%s %s" % addr,
|
||||
"run({}): {}".format(fno, ex),
|
||||
@@ -354,13 +355,7 @@ class HttpSrv(object):
|
||||
"shut({}): {}".format(fno, ex),
|
||||
c="1;30",
|
||||
)
|
||||
if ex.errno not in [10038, 10054, 107, 57, 49, 9]:
|
||||
# 10038 No longer considered a socket
|
||||
# 10054 Foribly closed by remote
|
||||
# 107 Transport endpoint not connected
|
||||
# 57 Socket is not connected
|
||||
# 49 Can't assign requested address (wifi down)
|
||||
# 9 Bad file descriptor
|
||||
if ex.errno not in E_SCK:
|
||||
raise
|
||||
finally:
|
||||
with self.mutex:
|
||||
|
||||
Reference in New Issue
Block a user