mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-08-27 20:40:13 +03:00
revert: restore force_close=True in compute._session()
The per-commit force_close=not _local optimisation reused TCP connections for the loopback compute, but _session() is also used for the controller's WebSocket heartbeat connection (_connect_notification -> ws_connect). The different connector behaviour prevented the compute from receiving pings, so no compute.updated events reached the WebUI and the compute cache stayed empty.
This commit is contained in:
parent
1dd334caff
commit
fdcc7058cb
@ -106,13 +106,7 @@ class Compute:
|
||||
|
||||
def _session(self):
|
||||
if self._http_session is None or self._http_session.closed is True:
|
||||
# Reuse TCP keep-alive for local compute (loopback) to avoid paying
|
||||
# a TCP handshake on every HTTP request; force-close for remote
|
||||
# computes in case intermediate firewalls/NATs drop idle connections.
|
||||
_local = self._host in ("127.0.0.1", "::1", "localhost")
|
||||
connector = aiohttp.TCPConnector(
|
||||
force_close=not _local, ssl_context=self._ssl_context
|
||||
)
|
||||
connector = aiohttp.TCPConnector(force_close=True, ssl_context=self._ssl_context)
|
||||
self._http_session = aiohttp.ClientSession(connector=connector)
|
||||
return self._http_session
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user