mirror of
https://gitee.com/xmz7891/ykxmz.git
synced 2026-10-18 23:00:44 +00:00
琚帶绔?- 淇 MTU 闂锛氬す MSS + 璺緞 MTU 鎺㈡祴锛堝叕缃戝彲鐢ㄧ巼 48% -> 100%锛?- 澶嶇敤 HTTP 杩炴帴锛堝厤鎺夋瘡娆℃柊寤?TLS 鐨?30% 鎻℃墜澶辫触锛?- 姣忓垎閽熷洖澶存壘灞€鍩熺綉锛岃嚜鍔ㄥ垏鍥炲揩 400 鍊嶇殑璺緞 - 鐢婚潰蹇冭烦甯э細闈欐鏃剁渷娴侀噺锛屽鎴风浠嶇煡閬撴祦鏄椿鐨?- 閿佸睆鏃剁粰鍑哄彲鎿嶄綔鐨勬彁绀? 鎵嬭〃绔?- 鍐呯疆 GTS Root R4 / GlobalSign Root CA锛屼慨 SSLHandshakeException - 杩炴帴閿欒缈昏瘧鎴愪汉璇濓紙璇佷功/鏃堕棿/瑙f瀽/瓒呮椂鍒嗗埆鎻愮ず锛?- 缁忎腑杞繛涓婂悗鐢ㄦ湇鍔″櫒鎶ョ殑鍦板潃鍒锋柊宸查厤瀵硅褰?- 鏂板灞€鍩熺綉杩炴帴椤甸潰銆佹湇鍔″櫒寤惰繜妫€娴? 鏈嶅姟鍣ㄧ - 鏀寔 chunked 璇锋眰浣擄紙淇瘡 16 绉掍竴娆$殑杩炴帴閿欎贡涓庡ぇ闈㈢Н 502锛?- 缃戠粶璋冧紭鑴氭湰 net-tune.sh锛堝紑鏈鸿嚜鍔ㄥ簲鐢級 - 绠$悊椤碉細鎵归噺鍒犻櫎銆佺綉缁滀綋妫€銆佷笅杞藉尯 - 闅ч亾鏀?HTTP/2 + 鍙岃繛鎺? 鏂囨。 - 璁稿彲鍗忚 / 瀹夎鍓嶅繀璇?/ 瀹夎鍚庨』鐭ワ紙浣滆€咃細灏忛害瀛愶級
78 lines
2.8 KiB
Python
78 lines
2.8 KiB
Python
# -*- coding: utf-8 -*-
|
|
"""修 test_boot_silent.py 里被我改坏的那一段。
|
|
|
|
背景:
|
|
开机静默运行时,如果配对码被别的设备占了,被控端会弹通知
|
|
(这是新功能,用户要求的)。但旧断言要求"开机后一个窗口都没有",
|
|
于是新功能一工作测试就失败。
|
|
|
|
正确的断言是:**允许临时通知窗口,但不许有常驻的控制窗口**。
|
|
|
|
上一次修改时缩进没处理好,还叠了三引号,用 PowerShell 传就炸了。
|
|
这次老老实实写文件。
|
|
"""
|
|
from __future__ import annotations
|
|
|
|
import ast
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
TARGET = Path(r"C:\Users\shu\Desktop\deepseekagent\LanRemote\_tests"
|
|
r"\test_boot_silent.py")
|
|
|
|
# 好的一段(缩进 8 空格,和周围对齐)
|
|
GOOD = [
|
|
" # 通知窗口是**应该**出现的:比如配对码被别的设备占了,\n",
|
|
" # 必须让用户看到「该配对码已被使用,请换一个配对码」,\n",
|
|
" # 否则用户永远不知道为什么连不上。\n",
|
|
" # 要保证的是:除了这种临时通知,没有常驻的控制窗口。\n",
|
|
' notices = [w for w in visible if "通知" in (w.get("title") or "")]\n',
|
|
" others = [w for w in visible if w not in notices]\n",
|
|
" if notices:\n",
|
|
' print(f" (有 {len(notices)} 个通知窗口,这是对的"\n',
|
|
' f" —— 说明它在提示用户什么事)")\n',
|
|
' check("★ 开机后没有常驻的控制窗口", not others, str(others[:3]))\n',
|
|
]
|
|
|
|
|
|
def main() -> int:
|
|
lines = TARGET.read_text(encoding="utf-8").splitlines(keepends=True)
|
|
|
|
# 找出要被替换的区间:从"通知窗口是"那行开始,到 check("★ ... 那行结束
|
|
start = end = None
|
|
for index, line in enumerate(lines):
|
|
if "通知窗口是" in line and start is None:
|
|
start = index
|
|
if start is not None and "开机后没有常驻的控制窗口" in line:
|
|
end = index
|
|
break
|
|
|
|
if start is None or end is None:
|
|
print(" [失败] 找不到要替换的区间")
|
|
return 1
|
|
|
|
print(f" 替换第 {start + 1} 到 {end + 1} 行({end - start + 1} 行)")
|
|
lines[start:end + 1] = GOOD
|
|
text = "".join(lines)
|
|
|
|
try:
|
|
ast.parse(text)
|
|
except SyntaxError as exc:
|
|
print(f" 语法错误: 行 {exc.lineno}: {exc.msg}")
|
|
if exc.text:
|
|
print(f" {exc.text.rstrip()}")
|
|
return 1
|
|
|
|
TARGET.write_text(text, encoding="utf-8", newline="\n")
|
|
print(" 语法 OK,已写入")
|
|
|
|
# 复核
|
|
for index, line in enumerate(text.splitlines(), 1):
|
|
if "常驻的控制窗口" in line or "notices = " in line:
|
|
print(f" {index}: {line}")
|
|
return 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(main())
|