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:
YueGuobin committed 2026-05-18 23:59:56 +08:00
1 parent c71dfbb6b5
commit 868e317d24
2 files changed
+22 -19

No files matched your search

+2 -2
View File
@@ -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: