fix(bridge): 根因修复——StreamReader 64KiB 限制致 OTA 144KB 请求行永远不可达(build 9→4MiB)

This commit is contained in:
agent committed 2026-07-29 03:27:48 +00:00
1 parent cbf7629dc8
commit 34adaf4b81
1 file changed
+4 -2
+4 -2
View File
@@ -27,7 +27,7 @@ import platform
import sys import sys
PROTOCOL_VERSION = 1 PROTOCOL_VERSION = 1
SERVER_BUILD = 8 # 2026-07-29: start/stop_notify 10s 超时 + connect subscribe 选项(OTA 净连接) SERVER_BUILD = 9 # 2026-07-29: StreamReader limit 64KiB→4MiB(OTA 144KB 请求行根因修复)
EPD_SERVICE_UUID = "13187b10-eba9-a3ba-044e-83d3217d9a38" EPD_SERVICE_UUID = "13187b10-eba9-a3ba-044e-83d3217d9a38"
EPD_CHAR_UUID = "4b646063-6264-f3a7-8941-e65356ea82fe" EPD_CHAR_UUID = "4b646063-6264-f3a7-8941-e65356ea82fe"
@@ -279,7 +279,9 @@ async def main():
ap.add_argument("--port", type=int, default=8971) ap.add_argument("--port", type=int, default=8971)
args = ap.parse_args() args = ap.parse_args()
server = BridgeServer() server = BridgeServer()
srv = await asyncio.start_server(server.handle, args.host, args.port) # limit: OTA 镜像请求 ~145KB(hex),远超默认 64KiB —— 必须显式放大(2026-07-29 根因)
srv = await asyncio.start_server(server.handle, args.host, args.port,
limit=4 * 1024 * 1024)
print(f"[bridge] listening on {args.host}:{args.port} " print(f"[bridge] listening on {args.host}:{args.port} "
f"(protocol v{PROTOCOL_VERSION}, platform {platform.system()})", flush=True) f"(protocol v{PROTOCOL_VERSION}, platform {platform.system()})", flush=True)
async with srv: async with srv: