mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-04 22:41:12 +02:00
Fix ConnectionResetError issues and switch to aiohttp version 3.4.4. Fixes #1474.
This commit is contained in:
1 parent
030714ae80
commit
f76b329cba
8 files changed
+31
-33
No files matched your search
@@ -221,6 +221,7 @@ class Route(object):
|
||||
response = Response(request=request, route=route)
|
||||
response.set_status(408)
|
||||
response.json({"message": "Request canceled", "status": 408})
|
||||
raise # must raise to let aiohttp know the connection has been closed
|
||||
except aiohttp.ClientError:
|
||||
log.warning("Client error")
|
||||
response = Response(request=request, route=route)
|
||||
|
||||
@@ -102,7 +102,10 @@ class WebServer:
|
||||
return
|
||||
|
||||
# close websocket connections
|
||||
for ws in set(self._app['websockets']):
|
||||
websocket_connections = set(self._app['websockets'])
|
||||
if websocket_connections:
|
||||
log.info("Closing {} websocket connections...".format(len(websocket_connections)))
|
||||
for ws in websocket_connections:
|
||||
await ws.close(code=aiohttp.WSCloseCode.GOING_AWAY, message='Server shutdown')
|
||||
|
||||
if self._server:
|
||||
|
||||
Reference in new issue
Block a user