Fix internal server on OpenBSD
On OpenBSD closed sockets are handled as exceptional conditions. Fixes #1062
This commit is contained in:
parent
e07f047fad
commit
f780853d8f
@ -260,7 +260,7 @@ def serve(configuration, shutdown_socket):
|
|||||||
max_connections = configuration.get("server", "max_connections")
|
max_connections = configuration.get("server", "max_connections")
|
||||||
logger.info("Radicale server ready")
|
logger.info("Radicale server ready")
|
||||||
while True:
|
while True:
|
||||||
rlist = xlist = []
|
rlist = []
|
||||||
# Wait for finished clients
|
# Wait for finished clients
|
||||||
for server in servers.values():
|
for server in servers.values():
|
||||||
rlist.extend(server.client_sockets)
|
rlist.extend(server.client_sockets)
|
||||||
@ -269,9 +269,7 @@ def serve(configuration, shutdown_socket):
|
|||||||
rlist.extend(servers)
|
rlist.extend(servers)
|
||||||
# Use socket to get notified of program shutdown
|
# Use socket to get notified of program shutdown
|
||||||
rlist.append(shutdown_socket)
|
rlist.append(shutdown_socket)
|
||||||
rlist, _, xlist = select.select(rlist, [], xlist, select_timeout)
|
rlist, _, _ = select.select(rlist, [], [], select_timeout)
|
||||||
if xlist:
|
|
||||||
raise RuntimeError("unhandled socket error")
|
|
||||||
rlist = set(rlist)
|
rlist = set(rlist)
|
||||||
if shutdown_socket in rlist:
|
if shutdown_socket in rlist:
|
||||||
logger.info("Stopping Radicale")
|
logger.info("Stopping Radicale")
|
||||||
|
Loading…
Reference in New Issue
Block a user