mirror of
https://github.com/9001/copyparty.git
synced 2026-11-22 11:02:34 +00:00
replace magic numbers with errno.*
This commit is contained in:
1 parent
046b494b53
commit
20c6b82bec
5 files changed
+53
-22
No files matched your search
@@ -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