vssh 3.6.6__tar.gz → 3.6.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {vssh-3.6.6/vssh.egg-info → vssh-3.6.8}/PKG-INFO +1 -1
- {vssh-3.6.6 → vssh-3.6.8}/pyproject.toml +1 -1
- {vssh-3.6.6 → vssh-3.6.8/vssh.egg-info}/PKG-INFO +1 -1
- {vssh-3.6.6 → vssh-3.6.8}/vssh.py +20 -2
- {vssh-3.6.6 → vssh-3.6.8}/LICENSE +0 -0
- {vssh-3.6.6 → vssh-3.6.8}/README.md +0 -0
- {vssh-3.6.6 → vssh-3.6.8}/setup.cfg +0 -0
- {vssh-3.6.6 → vssh-3.6.8}/vssh.egg-info/SOURCES.txt +0 -0
- {vssh-3.6.6 → vssh-3.6.8}/vssh.egg-info/dependency_links.txt +0 -0
- {vssh-3.6.6 → vssh-3.6.8}/vssh.egg-info/entry_points.txt +0 -0
- {vssh-3.6.6 → vssh-3.6.8}/vssh.egg-info/top_level.txt +0 -0
- {vssh-3.6.6 → vssh-3.6.8}/vssh_mcp_server.py +0 -0
- {vssh-3.6.6 → vssh-3.6.8}/vssh_p2p.py +0 -0
|
@@ -4017,7 +4017,7 @@ Env: VSSH_SECRET
|
|
|
4017
4017
|
result['info'] = json.loads(buf.decode())
|
|
4018
4018
|
except (json.JSONDecodeError, ValueError, UnicodeDecodeError) as e:
|
|
4019
4019
|
pass # e silenced
|
|
4020
|
-
s.close()
|
|
4020
|
+
s.close() # Always close — was only in full_mode, causing 13 dangling sockets on regular status
|
|
4021
4021
|
except OSError:
|
|
4022
4022
|
pass # safe to ignore
|
|
4023
4023
|
return result
|
|
@@ -4030,7 +4030,25 @@ Env: VSSH_SECRET
|
|
|
4030
4030
|
|
|
4031
4031
|
online = 0
|
|
4032
4032
|
total = 0
|
|
4033
|
-
#
|
|
4033
|
+
# Pre-warm WireGuard tunnels BEFORE status checks.
|
|
4034
|
+
# Fires short-timeout TCP probes to all peers simultaneously → triggers
|
|
4035
|
+
# WireGuard handshakes, then waits 1.2 s for them to finish.
|
|
4036
|
+
# By the time real checks run, all tunnels are warm → zero handshakes
|
|
4037
|
+
# during status → no disruption of the caller's active session.
|
|
4038
|
+
_peer_ips = [ip for ip in _servers.values() if ip and ip != _my_vpn_ip]
|
|
4039
|
+
def _prewarm(ip):
|
|
4040
|
+
try:
|
|
4041
|
+
_pw = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
|
4042
|
+
_pw.settimeout(0.15)
|
|
4043
|
+
_pw.connect((ip, PORT))
|
|
4044
|
+
_pw.close()
|
|
4045
|
+
except Exception:
|
|
4046
|
+
pass
|
|
4047
|
+
with concurrent.futures.ThreadPoolExecutor(max_workers=len(_peer_ips) or 1) as _wp:
|
|
4048
|
+
list(_wp.map(_prewarm, _peer_ips))
|
|
4049
|
+
time.sleep(1.2) # wait for WireGuard handshakes to complete
|
|
4050
|
+
|
|
4051
|
+
# Run checks in parallel for speed — tunnels are warm, no handshakes
|
|
4034
4052
|
results = []
|
|
4035
4053
|
with concurrent.futures.ThreadPoolExecutor(max_workers=14) as pool:
|
|
4036
4054
|
futures = {pool.submit(_check_node, n, ip): n for n, ip in sorted(_servers.items()) if ip}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|