mirror of
https://github.com/romanz/amodem.git
synced 2026-02-24 16:18:12 +08:00
server: make sure accepted UNIX sockets are blocking
It was a problem on Mac OS X, where sometimes we got EAGAIN errors from calling socket.recv() on them.
This commit is contained in:
@@ -63,6 +63,7 @@ def server_thread(server, handler, quit_event):
|
||||
|
||||
def accept_connection():
|
||||
conn, _ = server.accept()
|
||||
conn.settimeout(None)
|
||||
return conn
|
||||
|
||||
while True:
|
||||
|
||||
@@ -32,6 +32,9 @@ class FakeSocket(object):
|
||||
def close(self):
|
||||
pass
|
||||
|
||||
def settimeout(self, value):
|
||||
pass
|
||||
|
||||
|
||||
def test_handle():
|
||||
handler = protocol.Handler(keys=[], signer=None)
|
||||
|
||||
Reference in New Issue
Block a user