mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-05 06:41:13 +02:00
fix: close DockerHTTPClient session to prevent UnixConnector leak in Web Wireshark
The Web Wireshark WebSocket endpoint created a WebWiresharkManager but never called close(), leaving the DockerHTTPClient's ClientSession with UnixConnector unclosed when users closed the browser tab. Also switch asyncio.wait in WebSocket proxy from ALL_COMPLETED to FIRST_COMPLETED to avoid blocking cleanup when one direction disconnects.
This commit is contained in:
2 files changed
+22
-19
No files matched your search
@@ -127,7 +127,7 @@ async def websocket_proxy(
|
||||
try:
|
||||
done, pending = await asyncio.wait(
|
||||
aws,
|
||||
return_when=asyncio.ALL_COMPLETED
|
||||
return_when=asyncio.FIRST_COMPLETED
|
||||
)
|
||||
except Exception as e:
|
||||
log.error(f"asyncio.wait raised exception: {e}")
|
||||
@@ -264,7 +264,7 @@ async def websocket_proxy_with_manual_accept(
|
||||
try:
|
||||
done, pending = await asyncio.wait(
|
||||
aws,
|
||||
return_when=asyncio.ALL_COMPLETED
|
||||
return_when=asyncio.FIRST_COMPLETED
|
||||
)
|
||||
log.info(f"asyncio.wait returned. done={len(done)}, pending={len(pending)}")
|
||||
except Exception as e:
|
||||
|
||||
Reference in new issue
Block a user